Form Attributes Dialog

See Also

Use the Form Attributes dialog to specify the basic attributes of a form.  This dialog is displayed by selecting the Form Attributes command from the Form Design menu when a form is in design mode.

Dialog Entries

Name

A name for the form that can be up to 32 characters long.  The name is displayed in form selection lists.

ID

The form ID is the unique identifier of the form when it is stored in the database.  Enter an identifier from 1 to 8 letters (A-Z) or digits (0-9).  You must specify a unique identifier for a form before the form can be stored in the database.  Pop-up edit forms that are part of a list do not need identifiers, since they are saved with the list.

Search Window

Check this option if you want the form to have a search window.  A search window is a pop-up browse list that enables you to quickly locate and display a record from the database on a form.  If you add a search window, the search icon on the form's control pad will appear.

Data Exchange Template

Check this option if you want to add a data exchange template to the form.  When this option is checked, the DX Template button is enabled.

Control Pad

The control pad of a form contains icons that can be clicked to send commands to the form.  The control pad changes based on whether or not the form is in design mode.  For most purposes, you should include a control pad on the form.  If you decide to leave the control pad off for a particular form, the commands are also available on the form menu, or you can place user-defined buttons on the form to send the desired commands.

Database Permissions

Check this option	To

Add New Records	Allow the user of the form to add new records to the database through the form.  If this option is checked, the form must also contain all the required fields of the root table of the form view.

Edit Records	Allow the user to edit records with the form.

Delete Records	Allow the user to delete records with the form.

Data Button

Click the Data button to display the Data View dialog, which enables you to define the data view associated with the form.

DX Template Button

Select the DX Template button to display the DX Template dialog, which enables you to define the data exchange template associated with the form.


Designing Forms

Designing Lists

Designing Data Exchange Templates

Edit View Dialog


List Attributes Dialog

See Also

Use the List Attributes dialog to define the attributes of a list.

Dialog Entries

Name

A descriptive name for the list that can be up to 32 characters long.  The name is used most places in Ad Hoc to help you identify a list.

ID

The list ID is the unique identifier of the list when it is stored in the database Forms Table.  Enter from 1 to 8 letters (A-Z) or digits (0-9).  You must specify a unique identifier for a list before you can save it in the database.    Special lists that are part of a form, such as search windows and lists embedded in scroll regions, do not need identifiers, since they are saved as part of form.

Style

Specify the following style options for the list:

Style Option	Description

No Buttons	The list will contain no control buttons.

OkCancel	The list will contain two control buttons: OK and Cancel.  This style is for lists that are search windows of a form.

AddEditDelete	The list will contain three control buttons: Add, Edit, and Delete.  This style enables the list to be used for adding, editing, and deleting records.  It also attaches a pop-up edit form to the list, which you must design.

Control Pad

Select this option if you want the list to have a control pad. A control pad for a list contains a drop down index list, which enables the you to change the sort order of the list.  It also contains icons that you can click to send commands to the list.

Search Control

Select this option if you want the list to have a search control, which enables you to enter search keys to find a record in the list.

Database Permissions

You can set database access permissions for a list that has the AddEditDelete style.  A list with this style option has a pop-up form attached to it to enable adding and changing records.

Check this option	To

Add New Records	Allow the user of the list to add new records to the database through the list.  If this option is checked, the pop-up edit form must also contain all the required fields of the root table of the form view.

Edit Records	Allow the user to edit records displayed on the list.

Delete Records	Allow the user to delete records displayed on the list.


Designing Lists


List Column Fields Dialog

Use the List Column Fields dialog to designate the fields that will form the columns of the list and to edit the column headings of the list.

Column Fields

The list on the left of the dialog contains the fields that will be columns of the report, in the same order as the columns appear on the list from left to right.  The list on the right contains the fields in the data view that can be used for columns.  To add one of these fields to the column fields list, you can double click the field entry or click the left mouse button in the field, hold the button down, and drag the field to the desired spot in the list.

To add a field to the Column Fields list

Double click a field in the list on the right to add it to the end of the Column Fields list, or

Drag a field from the list on the right and drop it on the desired position in the Column Fields list, or

Highlight the field in the Available Fields list and select Add

To insert a field at a specified position in the Column Fields list

Click and hold the left mouse button on the field in the Available Fields list and drag it to the desired position in the Column Fields list, or

Highlight the field in the Available Fields list, highlight the field at the desired position in the Column Fields list, and select Insert

To delete a field from the Column Fields list

Double click the field you want to delete in the Column Fields list, or

Highlight the field in the Column Fields list and select Delete

To re-arrange the fields in the Column Fields list

Click on a field and drag it to the desired position in the list

To remove all the fields from the Column Fields list

Select Delete All.

Display Column Headings on the List

Check this option if you want column headings to appear on the list.

Column Heading Edit Box

The column heading edit box contains the column heading for the field selected in the Column Fields list.  The default heading is the field title stored in the data dictionary as part of the field definition.

You can edit the column heading for the field that is currently highlighted in the Column Fields list.  Column headings can be up to three lines.

Data View Button

Click the View button to display the Data View dialog, and edit the definition of the data view associated with the list.  Since only fields that are included in the data view can be assigned to columns in the list, you must define the fields in the data view before you can specify the fields that will be displayed on the list.

Fields With the Lookup List Validation Option

For fields you have defined with the Lookup List validation option, there are two entries in the list on the right.  Select the one without the asterisk to display the field value in a column (e.g. M for the Sex column), and select the one with the asterisk to display the lookup description defined in the data dictionary (e.g. male instead of M).  You can have either or both columns on a list.


Data View Dialog

The Data View dialog is the main dialog for defining a data view for a form, list, or report.  Use the Data View dialog to designate the fields for a form or report, the order in which they will be sorted, and an optional selection filter that determines which records from a table will be used.

Primary Table

At the top of the Data View dialog is a drop-down list of all the tables in the database. Use this list to specify a primary table (root table) for a the view. You must select a primary table before you can define the other characteristics of the view.  If you subsequently change the primary table selection, you must redefine the fields, sort order and filter because they are all  based on the primary table.  The data view for a report startup dialog does not have a primary table, so this drop-down list will not appear for report dialog views.

Display only Selected Fields

This option allows you to select the field display mode for the Data View dialog.

Check this option to display a list of all the fields that you have selected for the view, including fields from the primary table, fields from other database tables, and (for report views) report fields.

When this option is not checked, the dialog displays the Available Tables list and a list of fields from the selected table.  This display mode allows you to browse through all available tables in the database to selected fields for the view.

Available Tables

This is a list of the database tables from which you can select fields to be used in the view.  If the view supports local fields (such as counter fields and computed fields in report views) the first entry in this table will be for the local fields.  For a report view, this entry is called Report Fields.  The next entry in this list corresponds to the primary table you selected for the view (if the view has a primary table).

Subsequent entries in this list show additional tables from the database that can be related to the primary table of the view using the table links you defined for the table in the data dictionary.  In the case of a report startup dialog that does not have a primary table, you can define table links using the report fields.  (See Editing a Report Dialog Data View).

When you highlight a table in the Available Tables list, the list is expanded to include all the tables for which links are defined from the highlighted table.  In addition, the Field List, which appears below the Available Tables list, will display the fields defined for the highlighted table in the data dictionary.

When you highlight an entry in the available tables list, the Field List below it will display the following:

Highlighted Table entry	Field List will Display	When this entry is highlighted, you can
Report Fields (Report view)	Report fields you have defined, including total fields and computed fields	Add, edit, or delete report fields (total fields and computed fields)
Report Fields(Report startup dialog view)	Report fields that you have defined for the report view	Add, edit or delete table links from the report fields to tables in the database.
Primary Table	Fields in the primary table	Select primary table fields that will be used in the view
Any other table	Fields in the highlighted table	Select fields from the highlighted table that will be used in the view
Fields List

Below the Available Tables list is the fields list.  This list shows the fields defined for the table selected in the Tables list.  On this list, you can select the fields from that table that will be used in the data view.  The field list contains the ID of the field, its title (name), and icons that give additional information about the field:

	Indicates whether or not the field is selected for the view
	Indicates that the field is a required field
	Indicates the field is used to sort the view.
	Indicates the field is used in the filter for the view.

When a field is selected for the view, the check box to the left of the field name is checked and the field entry is highlighted.  The Field List can be sorted using the Sort List command (see below).

To Select a field in the Field List:

Check the check box to the left of the field name, or

Double-click the field entry with the left mouse button when the field is not selected, or

Hold the Ins key down and click the field entry with the left mouse button

To Un-Select a field:

Un-check the check box to the left of the field name, or

Double-click the field entry with the left mouse button when the field is selected, or

Hold the Del key down and click the field entry with the left mouse button

Sort

Select Sort (click the Sort button, or press Alt-S) to display the Sort Specification Dialog, which enables you to define the way the view records are sorted.  You cannot specify a sort for report startup dialog views.

Filter

Select Filter (Click the Filter button, or press Alt-F) to display the Filter Rules dialog, which enables you to define the filter, or selection criteria, for records in the view.  You cannot specify a filter for report startup dialog views.

If you do not define a filter for a data view, the records of the view will correspond on a one-to-one basis with the records in the primary table of the view.

Select All

Select Select All to select all of the fields in the Field List for the view.

All Required

Select All Required to select all the required fields in the Field List.  This command is available only when the Field List is displaying the fields of the primary table.  If you are defining a view for a form, and want to use the form to add new records to the database, you must include all required fields in the primary table.

Clear All

Select Clear All to un-select all the selected fields in the Field List.  This clears only the fields currently in the list and doesnt affect fields selected from other tables.

Sort List

Select the Sort List command to change the sort order of fields in the Field List.  This affects only the way fields are displayed in the list.  Click the Sort List button, then select the desired order from the button menu:

Sort	Description
Order in Table	Fields are listed in the order in which they were defined in the table definition in the data dictionary
By ID	Fields are listed by their field ID
By Name	Fields are listed by name (title)
New Field

For a report view, you can define new report fields when the Report Fields entry is highlighted in the Tables List.  Click the New Field button, then select the type of field from the button menu:

Select	To
Computed Field	Add a new computed field to the report view.  See Edit Computed Field Dialog.
Counter Field	Add a new counter field to the report view.  See Counter Field Dialog.
Edit Field

Select Edit Field, or double-click the field entry, to edit the definition of a view field.  This command is only available for report views when the Field List is displaying the report fields.

Delete Field

Select Delete Field to delete the currently highlighted view field.  This command is only available for report views when the Field List is displaying the report fields.

Table Links

The table links button appears on the Data View dialog only when you are defining the data view for a report startup dialog.  Click the Table Links button to Add, Edit, or delete a new table link for the dialog view.  See help on Editing a Report Dialog Data View.


Sort Specification Dialog

Use the Sort Specification dialog to define the sort order of a data view.  The sort order is defined by selecting an index, or by designating a list of fields in the view whose values will be used to sort the view records.  The order of the fields in the sort specification is important.  The first field in the list is the primary sort key, the second field is used next, and so on.

Sort Icon

The sort icon is made visible whenever you define a sort order that does not match an available index for the view.  This indicates that before a form or list is displayed, or a report is printed, Ad Hoc will first have to sort the records.

Available Indexes

The Sort Specification dialog shows the indexes that are available for the view.  These are the indexes that have been defined for the primary table.  You can select an index from this list, or specify a custom sort in the Sort Fields list.

Sort Fields

Enter fields in the Sort Fields list to specify a sort order for the view that is not available as an index.  At the bottom of the Sort Specification dialog are two lists:  The list box on the left (the Sort Fields list) displays the fields used for the sort.  The list box on the right (the Available Fields list) displays the fields that have been defined for the view that can be used to sort records.

To add a field to the Sort Fields list

Double-click the left mouse button on the field in the Available Fields list, or

Click and hold the left mouse button on the field and drag it to the Sort Fields list, or

Highlight the field in the Available Fields list and select Add

To insert a field in the Sort Fields list

Click and hold the left mouse button on the field in the Available Fields list and drag it to the desired position in the Sort Fields list, or

Highlight the field in the Available Fields list, highlight the field in the Sort Fields list at the position you want to insert the new field, select Insert

To delete a field from the Sort Fields list

Double-click the left mouse button on the field to delete in the Sort Fields list, or

Highlight the field in the Sort Fields list and select Delete

To remove all fields from the Sort Fields list

Select Clear All

To rearrange the fields in the Sort Fields list

Click and hold the left mouse button on a field and drag it to a new position in the list.

Descending Sort Order

If you want a field to be sorted in descending order (e.g. from Z to A instead of A to Z), check the Descending check box next to that field in the Sort Fields list.

Break Levels

Break levels are used primarily in reports (see Designing Report Breaks).  When you specify the sort order for a report, the Sort Fields list will contain a column of check boxes for selecting break levels.  To specify a break level for a sort field, check the Break check box for that field.

Note:  When you select a break level, all higher levels will automatically be selected.  When you un-check a level, all lower levels will be un-selected.


Filter Rules Dialog

Use the Filter Rules dialog to define a selection filter for a data view.  The Filter Rules dialog contains a list of the rules that make up the filter.  On this dialog you can add, edit, or remove the rules of the selection filter.  When you add a rule to this list, or edit a rule, the Edit Filter Rule dialog is displayed.

To add a filter rule

Select Add Rule (click the Add Rule button or press Alt-A).

To edit a filter rule

Double-click the rule entry in the list, or

Highlight the rule and select Edit Rule

To delete a filter rule

Highlight the rule and select Delete.

To remove all rules

Select Clear All.

To change the order of rules in the list

Click and hold the left mouse button on a rule and drag it to a new position in the list.

Rule connectors

Filter rules are connected to each other by the connectors and and or.  Each filter rule in the list, except the last one, displays the connection to the next rule.  To change this connection between and and or, click the left mouse button on the connection icon for that rule.  Rules are evaluated sequentially to determine whether or not a record passes the filter.  The combination of the first two rules is evaluated, and the result is combined with the next, etc.  If the result of list of rules is TRUE, then the record passes the filter.  If it is FALSE, the record does not pass (and is not considered part of the view).

Here is how the evaluation is done for two rules:

If Rule A is	and Rule B is	Then

TRUE	TRUE	A and B is TRUE

A or B is TRUE

TRUE	FALSE	A and B is FALSE

A or B is TRUE

FALSE	TRUE	A and B is FALSE

A or B is TRUE

FALSE	FALSE	A and B is FALSE

A or B is FALSE

Some combination examples:

TRUE and TRUE or FALSE is evaluated as TRUE

TRUE and FALSE and FALSE is evaluated as FALSE

TRUE or FALSE and TRUE is evaluated as TRUE

TRUE or FALSE and FALSE is evaluated as FALSE

Rule Option icons

If you specify options for a rule, the following icons are displayed for the rule in the rules list (see Rule Options in Edit Filter Rule Dialog):

Icon	Meaning
	Ignore if Null (True if Null) option - the rule is ignored (evaluated as TRUE) if the comparison value is a field with a null value
	The comparison is case sensitive
	The field is a date field and the month and day only option is set.


Edit Filter Rule Dialog

Use the Edit Filter Rule dialog to edit the definition of a filter rule.  A filter rule compares the value of a field in the view record against a fixed value or against the value of another field.  To define a filter rule:

1.	Select the field to be used for the rule in the list box on the left side of the dialog.

2.	Select the comparison operator for the rule from the list in the center of the dialog.

3.	Enter a comparison value in the edit box on the right side of the dialog.  For some views you can also compare the field against another field.  In this case, a list of available fields will appear below the comparison value edit box.  Select the field to be used for the comparison from this list.

Comparison operators

The comparison operators determine how the selected view field is compared against the comparison value (or the value of the comparison field)

Operator	The rule is TRUE for a field if

equals	the value of the field is equal to the comparison value

greater	the value of the field is greater than the comparison value

less	the value of the field is less than the comparison value

doesnt equal	the value of the field is not equal to the comparison value

greater or equal	the value of the field is greater than or equal to the comparison value

less or equal	the value of the field is less than or equal to the comparison value

contains	the field is of type Character and it contains the character string in the comparison value

not null	the field is not null, i.e. it contains a value (a field with a value of zero is not null)

null	the field is null (blank), it contains no value

Rule Options

Option	Meaning

case sensitive	This option is available if the view field for the rule is of type Character.  If you select this option, the comparison will take the case of the letters into account.  If the rule is not selected, the case of the letters will be ignored.

For case sensitive comparisons, "The" is not equal to "the".  Upper case letters (A-Z) come before lower case letter (a-z) in the sort order.  Therefore "Zoo" would come before (be less than) "airplane".

For most applications, do not select this option.

month and day only	This option is available if the view field for the rule is of type Date.  If you select this option, the comparison is made only for the month and day part of the date.

true if null	This option is available if you are comparing the view field to another field.  If this option is set, the rule is automatically TRUE if the comparison field is null.

Adding Consecutive Rules

To add several rules from the Edit Filter Rule dialog without returning to the Filter Rules dialog, define a rule, then click either the AND New Rule button or the OR New Rule button to start a new rule.  The button you use specifies the connector between the previous rule and the new rule.


Form Links Dialog

Use the Form Links dialog to define a link between two forms.  When two forms are linked, one is the master form and one is the dependent form.  The current record in the master form determines the records that are filtered in the view of the dependent form.

This dialog is displayed when a form or list is the active desktop object and you select the Form Links command on the File menu.  The active form or list is the master form, and the Form Links dialog will display all the dependent forms that are linked to it, as well as other forms on the desktop that you may link to it.  The Form Links dialog enables you to redefine existing links, add new linked forms, or delete existing links.

Linked Forms

The Linked Forms list shows the dependent forms and lists that are linked to the master form.  If the master form contains an imbedded list (scroll region) that is linked to it, the designation "(imbedded)" follows the linked form's name.  You cannot change the link definition or remove the link of an imbedded form link, but you can view the definition.

Open Forms

The Open Forms list shows the forms that are open on the desktop and available to be linked to the master form.  A form that is already linked as a dependent of another form is not available for linking.  A form can be a master to many dependent forms, but can have only one master.  You also cannot link a form to another instance of the same form.

To Link a form or list to the active form

1.	Select the form or list in the Open Forms list

2.	Click on Link, press Alt-L, or double-click the entry in the Open Forms list

3.	Describe the link in the Edit Link dialog

4.	The linked form will be added to the Linked Forms list

To Remove a link

1.	Highlight the linked form in the Linked Forms list

2.	Click on Unlink, press Alt-U, or double-click the entry in the Linked Forms list

3.	The form is removed from the Linked Forms list and returned to the Open Forms list

To change the way two forms are linked

1.	Highlight the linked form in the Linked Forms list

2.	Click on Edit Link, or press Alt-E

3.	Edit the link description on the Edit Link dialog

If the link is to an imbedded form or list, you cannot change the link definition, but you may view it.


Edit Link Dialog

Use the Edit Link dialog to define the link between two forms.  You will see this dialog when you link two desktop objects with the Form Links command on the File menu, and also when you define the link between a form and an embedded list designed on the form.

The Edit Link dialog contains two lists of fields.

On the left is a list of the fields in the data view of the dependent form to be linked.

On the right is a list of the fields in the data view of the master form.

To define a link, you will select one or more fields in the dependent form view that will be filtered by the value of a corresponding field in the master view.  A record in the dependent view is selected (passes the filter) only if all the fields defined in the link have the same value as the fields designated in the master form view.

To define a pair of linked fields

1.	Select a field from the dependent form's view in the list on the left

2.	If there is one or more equivalent field in the master form's view, these fields will be displayed in the list on the right

3.	Select the field in the master form's view on the right that the dependent field must match

4.	The match will be displayed in the box at the bottom of the Edit Link dialog

To remove a pair of linked fields

1.	Select the field from the dependent form view in the list on the left

2.	Select "none" in the list on the right

To remove all field matches (clearing the link definition)

1.	Click on Clear, or press Alt-C

You can enter as many field matches as you want to define the link between the forms.  As soon as you accept the definition of the link, by clicking the OK button, or pressing ENTER, the dependent form is linked to the master form.

Note: Depending on the number of records in the dependent form and the how heavily the link filters the dependent form, you may experience a delay after the link is defined as Ad Hoc reads through the dependent view to find records that match the link.  You may also experience a delay when you change records in the master form.


Fonts Dialog

Use the Fonts dialog to define the fonts for a form, list, or report.  This dialog is displayed by selecting the Fonts Command on the Form Design menu, the List Design menu. , or the Report menu.

The dialog displays a list of the items for which you can specify a font.  The name of the item is displayed using the font currently assigned to it, so you can easily see a comparison between the fonts used on the form or report. Select an item in this list to change its font.

Dialog Options

Point Size

Enter the size of the font in points (a point, the unit of measure used for the height of the font, is 1/72 inch).

Bold

Check this option for a bold font.

Italic

Check this option for an italic font.

Use Default

For a report, you can specify a default report font that can be applied to several elements of the report.  When you change the default report font, it changes the fonts for all elements using the default.  Select this option for each element using the default font.

Select Font Button

Click this button to display  a Font selection dialog that is supplied in Windows.  The Windows font selection dialog displays a list of all the fonts installed on your computer.  From this dialog you can select a font, a point size, and the other available font styles such as bold and italic.

Note: If you are designing a form or list that will be used on another machine or across a network, make sure that you select fonts that are available on other machines.


Colors Dialog

Use the Colors dialog to change the colors of a form or list.  This dialog is displayed by the Colors command on the Form Design menu and on the List Design menu.  The dialog contains a color combo box for each text or background color that you can change.

The default color of an object is the color that is supplied by Windows based on color selections that the user makes with the Windows Control Panel.  To override the default, select a specific color.  The default color is displayed in the combo box as it is defined by the Control Panel.

Text colors must be solid colors.  These are the colors supported by the video hardware.  The 16 colors listed in the text color combo boxes correspond to the 16 solid colors available on 16-color video displays.  All other colors are created on 16 color displays by dithering (creating a pattern of solid colors that match the desired color).  If you were to specify a dithered color for text, Windows would actually use the closest solid color, therefore the Color dialog only allows the solid colors for text.

Background colors for forms and lists can be any custom color.  The color combo boxes for background colors contain the basic solid colors plus an extra entry for a custom color.  You can specify a different custom color for each background color on the Colors dialog.  The selected background color applies only to the current form or list.  To specify a custom color, click the Palette button next to the appropriate color combo box.

Palette button

Click the Palette button next to a color combo box to display the Background Color dialog.  This dialog gives you an expanded palette for form and list background colors.

Form Control Colors (Data Background Colors)

Edit Boxes that do not have the Border style are displayed using the selected Data Background color when the form is in design mode.  This helps you see the size and location of the control.  However, when the form is not in design mode, controls without borders are displayed using the form background color for aesthetics.

Text Boxes cannot display dithered background colors correctly because of a limitation in Windows, so if you specify a dithered color for the data background, Ad Hoc uses the nearest solid color for text boxes.

Warning:  Make sure you choose different colors for the text and background of an object, or the text will not appear.  Experiment until you find a pleasing color combination.

Hint:  When you are designing a form, it helps to make the form background color and the data background color different.  This will help you locate and size controls on the form.  A control with no border style and with no data displayed will be invisible on the form unless it is selected, or unless it is a different color than the form.


Background Color Dialog

You can specify a custom color using the Background Color dialog.

Basic Colors.  The 64 Basic Colors shown are the closest colors to the 16 solid colors available for text colors.  To select a color from the Basic group, click on it to highlight it, then click OK.

Custom Colors.  The 16 Custom Colors on the dialog are initially the solid colors that appear in the color combo boxes on the Colors dialog.  To select a color from the Custom colors group, click on it to highlight it, then OK.  You can change these custom colors to define your own custom palette of background colors.

To define a custom color, click the Define Custom Colors button to display the color selection chart then click the spot on the chart that matches the color you want, or specify the color by changing either the Hue/Saturation/Luminosity settings or the Red/Green/Blue settings.  To use this color for your background color without adding it to the custom color palette, just click OK.

To add a defined color to the custom color palette, first click on the color in the Custom Colors group that you want to replace, then define the color on the color chart and click the Add to Custom Colors button.  The custom color palette is saved when you click OK. On the Background Color dialog, even if you subsequently cancel the entries on the Colors dialog.


Edit Box Attributes Dialog

Use the Edit Box Attributes dialog to define the attributes of an edit box on a form.  This dialog is displayed when a form is in design mode and you:

Select the New Edit command on the Form Design menu

Select the Edit Control Attributes command on the Form Control Design Menu when an edit box is selected.

Dialog Options

Field

The Field list contains a list of the fields defined in the data view associated with the form.  Select the field that you want to display in the edit box you are defining.

NOTE: only the fields that you have selected on the Edit View dialog will appear in this list.

Title

Enter the title, if any, to be attached to the edit box.  Ad Hoc will supply the description of the field from the data dictionary as a suggested title, but you can change the title if you wish.

Title Position

Select the position of the title on the form relative to the position of the edit box.

Position	Description

None	No title will be displayed

Left	The title will appear to the left of the edit box

Right	The title will appear to the right of the edit box

Above	The title will appear above the edit box, aligned with the left edge of the control

Below	The title will appear below the edit box, aligned with the left edge of the control

Style

Select the display style of the edit box:

Style	Description

None	The edit box will display its contents only.  It will have no border or underline.

Underline	The edit box will appear with a line under the contents.  This will make it appear as an entry on a paper form.

Border	the edit box will have a single line border around the data area.

An edit box with no title and no display style (and no displayed contents) will be hard to locate on the form when you are laying the form out.  To more easily lay out the form, it is suggested that you change the colors so that the form background and data background colors are different during the design process.  You can change them back later, if desired.

Display Only

Check the Display Only option if you want the edit box to display the field data, but not allow the user to edit the data.  A display-only control cannot be edited, and cannot be tabbed to (although when you are setting the tab order of the form, you should include it).  If you have defined the field displayed in the edit box as a field from a table other than the root table of the form view, the Display Only attribute will automatically be set.  You can edit only fields from the root table of the view.

Don't validate using table links

Normally, if a field in a form view is part of a link to another table, Ad Hoc will use the link to validate the value you enter into the field.  It also uses the link to display a lookup window to allow you to select a value from a list.

If you check this option, Ad Hoc will not validate your entries in this control against the lookup table, allowing you to enter values that don't appear in the lookup table.

Note:  If you import records with a data exchange template attached to a form, the import process will not use table links to validate fields with this option set.


Combo Box Attributes Dialog

Use the Combo Box Attributes dialog to define the attributes of a combo box control on a form.  This dialog is displayed when a form is in design mode and you:

Select the New Combo Box command on the Form Design menu.

Select the Edit Control Attributes command on the Form Control Design Menu when a combo box control is selected.

A combo box can be used to edit a field that has been assigned the Lookup validation style (See Define Field Dialog).  The valid lookup values you define for the field appear in the drop down list of the combo box.  A combo box cannot be display only.  If you want to only display a field on a form, use a display-only edit box.

If the definition of a field allows the field to be blank (contain a null value).  The drop down list of the combo box contains a n/a entry.  Selecting n/a on the combo box sets the field value to a blank (null).

Dialog Options

Field

The Field combo box contains a list of the fields defined in the data view associated with the form that have a Lookup validation type.  Select the field that will be edited in the combo box control you are defining.

Title

Enter the title, if any, to be attached to the combo box control.  Ad Hoc will supply the description of the field from the data dictionary as a suggested title, but you can change the title if you wish.

Title Position

Select the position of the title on the form relative to the position of the combo box control .

Position	Description

None	No title will be displayed

Left	The title will appear to the left of the combo box

Right	The title will appear to the right of the combo box

Above	The title will appear above the combo box, aligned with the left edge of the control

Below	The title will appear below the combo box, aligned with the left edge of the control

Style

Select the display style of the combo box:

Style	Description

Display Field Value	The drop-down list contains the valid values that can be assigned to the database field attached to the control.

Display the Lookup Description	The drop-down list contains the descriptions of the valid values that are defined in the data dictionary.  Selecting a description in the combo box places the corresponding value in the field.

Display the Value and Description	Both the valid field values and their descriptions are displayed.  Each entry in the drop-down list contains a valid value followed by the description in parentheses.


Text Box Attributes Dialog

Use the Text Box Attributes dialog to define the attributes of a text box control on a form.  This dialog is displayed when a form is in design mode and you:

Select the New Text Box command on the Form Design menu.

Select the Edit Control Attributes command on the Form Control Design Menu when a text box control is selected.

A text box control must be used to edit a field of type Text.  A text box is similar to an edit box, except that it can display more than one line of text.  If the contents of the Text field are too large to display in the text box, scroll bars allow you to scroll through the text.

Dialog Options

Field

The Field combo box contains a list of the fields of type Text defined in the data view associated with the form.  Select the field that will be edited in the text box control you are defining.

Title

Enter the title, if any, to be attached to the text box control.  Ad Hoc will supply the description of the field from the data dictionary as a suggested title, but you can change the title if you wish.

Title Position

Select the position of the title on the form relative to the position of the text box control .

Position	Description

None	No title will be displayed

Left	The title will appear to the left of the text box

Right	The title will appear to the right of the text box

Above	The title will appear above the text box, aligned with the left edge of the control

Below	The title will appear below the text box, aligned with the left edge of the control

Style

Select the desired display style options of the text box:

Style	Description

Border	Check this option to display a border around the text box.

Vertical Scroll Bar	Check this option to include a vertical scroll bar on the right side of the text box.  If there is no scroll bar, you can still scroll through the contents of the text box with the up and down cursor keys.

Display Only	Check this option to make the text box display only.  The user cannot edit the contents of a display only text box.


Check Box Attributes Dialog

Use the Check Box Attributes dialog to define the attributes of a check box control on a form.  This dialog is displayed when a form is in design mode and you:

Select the New Check Box command on the Form Design menu.

Select the Edit Control Attributes command on the Form Control Design Menu when a check box control is selected.

A check box control can be used for only for fields with the following characteristics:

Character field with a length of 1.

The field has the Set validation type

The set of valid characters contains exactly two characters, of if the field is not defined as a required field, the valid character set can contain either one or two characters.

If the check box control is checked, the first character in the valid character set is placed in the field, otherwise the second character is placed in the field (or if no second character is defined for non-required fields, the field is blanked out).

Dialog Options

Field

The Field combo box contains a list of the fields in the forms data view that meet the above requirements.  Select the field that you want to attach to the check box control.

Title

Enter the title, if any, to be displayed with the control.  Ad Hoc will supply the description of the field from the data dictionary as a suggested title, but you can change the title if you wish.

Title Position

Select the position of the title relative to the check box control .

Position	Description

None	No title will be displayed

Left	The title will appear to the left of the check box

Right	The title will appear to the right of the check box

Style

Select the desired display style options of the check box:

Style	Description

Display Only	Check this option to make the check box display only.


Frame Attributes Dialog

Use the Frame Attributes dialog to define the attributes of a frame control on a form.  This dialog is displayed when a form is in design mode and you:

Select the New Frame command on the Form Design menu.

Select the Edit Control Attributes command on the Form Control Design Menu when a frame control is selected.

A frame control can be used to place a border around an area of a form, such as a group of related controls.  A frame can be a rectangular border, a horizontal line, or a vertical line.  The frame can have a title, located in various positions, and this title can have a font and color separate from the default title fonts and colors of the other controls.  You can also make the frame border invisible if you just want to place text on the form.

Dialog Options

Title

Enter the title, if any, to be displayed with the frame.

Title Position

Select the position of the title relative to the frame control .  You can select combinations of the following positions:

Position	Description

Left	The title will be placed next to the left side of the frame

Centered	The title will be centered horizontally in the frame

Right	The title will be placed next to the right side of the frame

Top	The title will be placed at the top of the frame

Bottom	The title will be placed at the bottom of the frame

Outside Frame	The title will be placed outside the frame border if this options is checked, otherwise it will be inside the border

Style

Select the desired style option for the frame:

Style	Description

Frame	A rectangular frame that you can re-size horizontally and vertically

Horizontal Line	A horizontal line, only the length can be changed

Vertical Line	A vertical line, only the length can be changed

Border Styles

Select the desired border style option:

Style	Description

No border	The frame border is invisible, only the title is visible

Plain	The border is a plain black line

Raised	The frame appears as a raised area on the form

Inset	The frame appears as an inset area on the form

Embossed	A style that makes the frame appear embossed on the form

Font

Check the Default option for the font if you want the frame title to have the default title font defined for the form.

Click the Font button to define a custom title font for the frame.

Text Color

Check the Default option for the title text color if you want the frame title to be the default title color for the form.  Select a color from the color combo box if you want a different color for the frame title.


Button Attributes Dialog

Use the Button Attributes dialog to define the attributes of a button control on a form.  This dialog is displayed when a form is in design mode and you:

Select the New Button command on the Form Design menu.

Select the Edit Control Attributes command on the Form Control Design Menu when a button control is selected.

A button can be placed on a form to send a command to the form.  In the current version of Ad Hoc, only the standard form commands can be assigned to a button.  These are the commands that appear on the form menu and the forms control pad.

Buttons currently dont add any additional functions to forms, but can be a design enhancement.  For example, putting OK and Cancel buttons on the pop-up edit form of a list makes it feel more like a regular Windows dialog.

Dialog Options

Command

Select the command that you want the form to receive when the button is clicked.

Title

Enter a title for the button.  When the command is selected, Ad Hoc supplies a default title that you can change.


Scroll Region Attributes Dialog

Use the Scroll Region Attributes dialog to define the attributes of a scroll region control on a form.  This dialog is displayed when a form is in design mode and you:

Select the New Scroll Region command on the Form Design menu.

Select the Control Attributes command from the Form Design Menu when a scroll region control is selected (highlighted).

Select the Control Style command on the List Design menu of the list that is embedded in the scroll region.

A scroll region is a special type of form control that enables an embedded list to be placed on a form.  You design the attributes of the scroll region control with this dialog, and design the attributes of the list using the List Design menu that is displayed when you click the right mouse button when the mouse cursor is over the list.

Dialog Options

Title

Enter the title, if any, to be attached to the scroll region.  There is no default supplied.  Enter a title that relates to the contents of the list embedded in the control.

Title Position

Select the position of the title on the form relative to the position of the scroll region .

Position	Description

None	No title will be displayed

Left	The title will appear to the left of the scroll region, aligned with the bottom edge

Right	The title will appear to the right of the scroll region, aligned with the bottom edge

Above	The title will appear above the scroll region, aligned with the left edge

Below	The title will appear below the scroll region, aligned with the left edge


Quick Form Layout Dialog

Use the Quick Form Layout dialog to have Ad Hoc automatically place edit boxes on a new form.  This dialog is displayed by selecting the Quick Layout command on the Form Design menu.  Quick Layout can be done only if the form does not yet contain controls.

Before using this dialog, use the Data View dialog to select the fields that you want to use for the form.  These fields will appear in the Available Fields list on the right side of the Quick Form Layout dialog.  Select the fields that you want to appear on the form by adding them to the Selected Fields list on the left side of the Quick Form Layout dialog.

If you want to use a control other than an edit box (e.g. a combo box or check box control) for a field, don't include that field in the list.  Or you can include it in the list to make a place for it, then later delete the edit box and replace it with a combo box control.

Selected Fields

The Selected Fields list on the left side of the dialog contains the fields for which edit boxes will be created.  The Available Fields list on the right contains all the fields in the data view associated with the form that can be assigned to an edit box.  It will not contain Text fields, or fields of other types that cannot be edited in an edit box.

To add a field to the Selected Fields list

Double-click the left mouse button on the field in the Available Fields list, or

Click and hold the left mouse button on the field and drag it to the Sort Fields list, or

Highlight the field in the Available Fields list and select Add

To insert a field in the Selected Fields list

Click and hold the left mouse button on the field in the Available Fields list and drag it to the desired position in the Sort Fields list, or

Highlight the field in the Available Fields list, highlight the field in the Sort Fields list at the position you want to insert the new field, select Insert

To delete a field from the Selected Fields list

Double-click the left mouse button on the field to delete in the Sort Fields list, or

Highlight the field in the Sort Fields list and select Delete

To remove all fields from the Selected Fields list

Select Delete All

To rearrange the fields in the Selected Fields list

Click and hold the left mouse button on a field and drag it to a new position in the list.

Vertical Separation

Controls will be placed on the form one below the other.  Vertical separation defines the distance between the bottom of one control and the top of the next.  A vertical separation of 8 is equivalent to the height of a character in the font you have selected for the data on the form.  A vertical separation of 4 is the default.

Left Margin

Enter a number for the distance each control will be placed from the left edge of the form.  A left margin of 4 is equivalent to the average width of character in the font you have selected for the data on the form.  A left margin of 4 is the default.

Title Position

This option cannot be changed in the current version of Ad Hoc.  All controls will be created with a Left style title position.

Border Style

Select the border style that all controls will have (See Edit Control Attributes dialog for a description of the border style options).


Data Exchange Template Dialog

Use the Data Exchange Template dialog to define the attributes of a data exchange template attached to a form.  This dialog is displayed when you select the Data Exchange Template command on the Form Design menu.

Dialog Options

Record Format

Select the format of the file that data will be imported from or exported to.

Format	Description

Fixed Field ASCII	The file is an ASCII text file.  Records in the file are separated by a carriage return-line feed combination.  Within each record the fields are a fixed length defined in the DX Record Layout dialog.

Delimited ASCII	The file is an ASCII text file.  Records in the file are separated by a carriage return-line feed combination.  Within each record the fields are separated by a delimiter character.  In the current version, this must be a comma.

If a field contains the delimiter character, the entire field must be enclosed in double quote characters ("xxx").  On export, Ad Hoc  always adds the double quotes.

Comma Separated Values	The same as Delimited ASCII above, except that the field delimiter is always a comma.

Date Format Option

Select the date format used when exporting Date fields, or expected when importing Date fields.  See Date Field for a description of the date format options.  All date formats can be exported.  Some date formats cannot be imported.  If you select one of these, Ad Hoc will warn you that it cannot import the date format you selected.

For fixed-field ASCII records, make sure the length of a date field is large enough to accommodate the selected format.

Export Upper Case

Check this option if you want fields in exported records to be in all upper case letters.  This does not affect records that are imported.  The case of records imported into the database is controlled by the case specified in the definition of each field in the data dictionary.

Layout Button

A data exchange template must include a field layout, which designates how the characters in an ASCII record relate to fields in the database.  Click the Layout button to display the DX Record Layout dialog.  For fixed-field ASCII record types, the position and size of the fields in the list is important.  For delimited ASCII or comma separated value record types, only the order of the fields is important.  The information in the layout must match exactly the actual layout of imported records, or the import operation will generate errors.


DX Record Layout Dialog

Use the DX Record Layout dialog to define the record layout of the ASCII records that will be imported or exported using a data exchange template.  The dialog contains two list boxes.  The list box on the left (the Layout list) displays the list of fields defined in the layout.  The list box on the right (the View Fields list) displays the fields of the data view associated with the data exchange template.  (The view for the template is the same as the data view associated with the form that the template is being defined for.)

Click on	or Press	To

Add	Alt-A	Add the field selected in the View Fields list to the end of the Layout list

Insert	Alt-I	Insert the field selected in the View Fields list before the field selected in the Layout list

Edit	Alt-E	Edit the length of the field selected in the Layout list

Delete	Alt-D	Delete the field selected in the Layout list

When you add a field to the Layout list, it is added with a length equal to the edit length that you specified when you defined the field in the data dictionary.  You can change this length by using the Edit button or double-clicking on the field entry in the Layout list.  The field length applies only if you are exporting to or imported from a file in a fixed-field format.

Warning

If you are exporting data, and the field in the database is longer than the field length defined in the record layout, the field contents are truncated.  If the field in the database is shorter, the field in the export file is padded on the right with blanks.

If you are importing data, and the field in the database is shorter than the field length defined in the record layout, the field contents are truncated.

Sample Record

At times, you have an existing file of data that you want to import, but may not be sure of the layout of the file.  The Sample Record area of the DX Record Layout dialog provides support to determine if your layout matches the data in a sample record of the file to be imported.

Note: Use the Sample Record area of the dialog only for files that have a fixed-field format.

To look at a sample record of a file to be imported, enter the pathname of the file in the File Pathname edit box.  Then click the Sample button.

A sample of the first record in the file will appear in the record display area.  When you select a field in the Layout list, the corresponding region of the sample record will be highlighted.  Check each field to see if your layout makes sense.  The end of the record is marked by a vertical line, which should not be highlighted when you select the last record in your layout.


Data Import Dialog

Use the Data Import dialog to start a data import process.  This dialog is displayed when you select the Import command on the Form menu.

Dialog Options

Input File Pathname

Enter the full pathname of the file that contains data that you want to import, or click the Browse button to display a File Open dialog to help you select the file.

Delete after importing

Check this option if you want the file deleted after the data is imported.  If you select this option, make sure that you have selected a suspense file option, so that records with errors will be saved to a suspense file so that you can correct them and read them later.

Record Edit Options

The record edit option determines when records read from the input file are displayed on the form for you to review and edit before they are imported into the database.

Option selected	Action taken

Don't display imported records	None of the records imported are displayed on the form, the import proceeds uninterrupted.  If records contain errors, they are put into a suspense file (if one is defined) or simply skipped without notifying the user.

Display only records with errors	Imported records that contain errors are displayed on the form, and the import process waits until the user edits the record and either inserts it into the database or cancels the update.

Display all records	Each imported record is displayed on the form, allowing the user to edit or approve each record before it is inserted into the database.

Suspense file for records with errors

If you want records that contain errors to be stored in a suspense file for later editing, enter a valid pathname for the suspense file or click the Browse button to display a File Open dialog to help you select a suspense file.  You can later edit the records in this file and insert them into the database.

Option	Description

Dont use	The suspense file is not used.  Records with errors are just skipped.  This is the default if no file name is supplied.

Append	New records are appended to the end of the suspense file.

Overwrite	If the suspense file that you enter contains data, it is deleted before new records are added to the suspense file.

Browse

Select Browse to display a file dialog to help you find the input file or the suspense file.

Edit Template

You can make changes to the data exchange template just before you run an import by selecting the Edit Template command on the Data Import dialog.  This displays the Data Exchange Template dialog for you to view or change the template, including the import file format and field layouts.

The changes you make remain with the data exchange template attached to the form until you close the form.  They are not stored permanently with the form design unless you subsequently save it.


Data Export Dialog

Use the Data Export dialog to start a data export process.  This dialog is displayed when you select the Export command on the Form menu.

Dialog Options

Output File Pathname

Enter a valid file pathname for a file that will receive the records exported from the database, or click the Browse button to display a File Open dialog to help you select a file.

Browse

Select Browse to display a file dialog to help you locate the directory for the output file and check for existing files in that directory.

If output file exists

If the file you specify exists, one of these options is used:

Export Option	Description

Append	The exported records are appended to the contents of the file.

Overwrite	The contents of the file are replaced by the exported records.

Edit Template

You can make changes to the data exchange template just before you run an export by selecting the Edit Template command on the Data Export dialog.  This displays the Data Exchange Template dialog for you to view or change the template, including the export file format and field layouts.

The changes you make remain with the data exchange template attached to the form until you close the form.  They are not stored permanently with the form design unless you subsequently save it.

Filter

You can change the record selection filter of the forms data view just before you run an export by selecting Filter on the Data Export dialog.  This displays the Filter Rules dialog, where you can view or change the current filter of the view.  The changes you make to the filter remain after the export is finished.  You can select the forms filter command to clear or change the filter.  See Changing the Record Selection Filter.

Records are exported using the sort and filter options defined for the data view of the form. The current index is the one specified in the Search Window of the form.


Form Selection Dialog

Use the Form Selection dialog to select a form, list, or desktop layout from the database.  Use the up and down arrow keys to highlight the desired selection, or just click on it with the mouse.  Then press the Enter key, click the OK button, or double-click the left mouse button to select the highlighted entry.

The check boxes below the list enable you to select the type of object that appears in the list.

The list box in this dialog is an Ad Hoc list, which means that you can use Ad Hoc keystroke navigation to highlight an entry.


Attached Report Dialog

Use the Attached Report dialog to attach a report to form or list.  This dialog is displayed when you select the Attach Report command on a form menu or a list menu.

The changes made using this dialog (attaching or detaching a report, etc.) are discarded when the form is closed unless you make them while the form is in design mode (or before you save the form after leaving design mode) and then save the form design.

Dialog Options

Select button

Click the Select button to display the Report Select dialog.  Select a report from the report list to attach to the form or list.  The selected report must be based on the same database table (the root table of the report data view) as the form or list.  If you select a report that is not based on this table, Ad Hoc displays an error message.

Clear button

To detach a report from the form or list, click the Clear button.

Auto Print

Normally, the current record displayed on a form or list would be printed on the attached report if you select the Print Record command.  Additionally you can select one or more automatic record print options:

Option	Prints the current record automatically

Adds	After a new record in inserted

Edits	After a record is changed and updated

Deletes	Before a record is deleted

Keep Open

Select this option if you want the report to stay open after the first record is printed.  If the option is not selected, the report is closed (ended) after each record is printed.  When the report is closed, a form feed is sent to the printer.  Keeping the attached report open may tie up your printer or the Print Manager until you close the report or close the form.

Select this option if you will be printing a number of records, and want them to appear on the same report.

Dont select this option if you are using the attached report to print a separate page for each record (e.g. a printed copy of the contents of the form) and will only occasionally print a record.


Database Table Dialog

See Also	Procedures

Use the Database Table dialog to define a database table.  The table definition is stored in the data dictionary of the database.  This dialog is displayed when you select the New Table command or the Edit Table Definition command on the Tables menu.

Using this dialog, you can define a database table, along with its fields, indexes, and links to other tables.

Dialog Entries

Name

Enter a descriptive name for the table.  The name can be up to 32 characters.  Use a name that makes it easy for the user to identify the table.  The name can be changed later if necessary.

Table ID

Enter a unique identifier for the table in the database.  A Table ID can be a combination of one to eight characters: letters (A-Z) or digits (0-9).  The Table ID should convey some meaning to the user of what the table contains, if possible.  When you first fill out this dialog for a new table you can change the ID up to the point that you accept the dialog entries.  Once a table definition has been entered into the data dictionary, you cannot change the ID.

File Name

Enter the filename for the table file.  Ad Hoc will suggest as a default filename the Table ID with the extension .DBF.  You can change this default to any valid filename for a new table.

Note: If you change the file name in the table definition for an existing table, Ad Hoc will not change the name of the file on disk.  Instead, it will look for a file with the new name, and, if it finds one,  use it for the table file.

Directory

Leave this entry blank if you want the file to be created in the same directory as the data dictionary and database system files.  If, you want the table file to be in located in a different directory or disk, enter the pathname of the directory here.  (Don't include the filename.)  For example, if you want the file to be located in a subdirectory called DATA on drive C:, enter C:\DATA for the path.

You can enter the single character $ to tell Ad Hoc to place the table file in the same directory as the program.  This is used for the report Styles table, so that it can be easily used in any database you create.

Fields Button

Click the Fields Button to see or fill out a list of the fields defined for the table.

Indexes Button

Click the Indexes Button to see or fill out a list of the indexes defined for the table.

Links Button

Click the Links Button to see or fill out a list of the links to other tables defined for this table.

To work with items in the list

Click on	or Press	To

Add	Alt-A	Add an item (field, index, or link) at the end of the list.

Insert	Alt-I	Insert an item before the item that is selected in the list.

Change	Alt-C	To change the definition of the selected item in the list.

Delete	Alt-D	To delete the selected item in the list.

Hint

You can double-click on an item in the list to display the dialog for that item.


Designing Tables

Designing a Database

Define Field Dialog

Define Index Dialog

Define Link Dialog

Introduction to Databases


Define Field Dialog

Use the Define Field dialog to define a field in a database table.

 Dialog Entries

Name

Enter a name for the field of from one to 32 letters or digits.  This name will be used to identify the field in lists and will be suggested as a default title for form controls and a default column title in lists and reports.

ID

Enter a unique identifier for this field.  No two fields in the same table can have the same ID.  Fields in different tables can have the same ID, but you should avoid this for sake of clarity.  The ID can be any combination of from one to eight letters (A-Z) and digits(0-9).

Non-null Values Required

Check this option if want to require that the field contain a value (cannot be null, or blank) in each record in the table.  When you enter data on a form, Ad Hoc will require that an entry be made for the field if the required option is checked.  By definition, the fields that comprise the primary key of a table are required fields.

Data Type

Select the data type of the field.

Edit Length

Select the number of characters that you want to be able to enter when entering a value for the field.   For Character fields, this is also the size of the field as it is stored in the record.  For numeric and date fields it determines the number of digits you can enter, but does not affect the size of the field (see Data Types for field sizes).

Decimal Positions

Select the number of decimal positions a Numeric field will have when formatted for output.

Max Size

Enter the maximum size in characters that a Text field can expand to.  If you leave this entry zero, the maximum size will be default maximum size defined by the table file type.  For Ad Hoc table files, this default size is 55,000 characters.  If a table contains more than one Text field, the total maximum lengths of all Text fields cannot exceed the maximum size limit of 55,000.

Input Case Control

Select one of the following options:

Case Option	Description

None	The user can enter letters in either upper or lower case and digits.

Upper	All letters entered by the user are shifted to upper case.

Numeric	The user can only enter digits and the following punctuation characters: . / + -

Validation Type

Select a optional validation type for the field:

Type	Description

None	The field is not validated using rules stored in the data dictionary

Range of Values	The field must be between a range of values (inclusive) stored in the data dictionary

Lookup List	The field value must equal one of the values defined for the field in the data dictionary

Set of characters	Each character in the field must belong to a set of characters stored in the data dictionary.

In addition to the validation rules defined in the data dictionary, other validations tests are performed by Ad Hoc when the user enters a value for a field:

If the field is required, the user must enter a value for the field

If the field is part of a foreign key described by a link defined for the table, the value a user enters in the field must equal the primary key value of a record in the linked table.  That is, the linked table defined in the link definition becomes a lookup table for the field value.

Note:  If you select the Lookup validation option for a field, you can include a descriptive phrase with each value. This description can be displayed in combo box controls on forms instead of the actual field value.  When the field is included on a list, the description is displayed instead of the actual field value.

For example, in the sample database, there is a lookup validation defined for the employee Sex field.  Two valid values for the field are defined: M and F.  Two descriptions are also defined: male and female.  If you use a combo box to edit this field on a form, you can specify that the combo box list display the descriptions instead of the field values.  If this field is included as a column in a list, the descriptions male and female will be displayed in the list instead of M and F.

Edit Validation Values Button

If a validation type is defined, you can click the Edit Validation Values button to edit the validation rules.

For Validation Type	the Edit Button will display

Range	Validation Range dialog

Lookup	Validation Codes dialog

Set	Validation Set dialog


Data Types

A database field can have one of the following data types

Type	Description	Size
Character	Fixed-size field of alphanumeric characters	defined by user
Short Integer	Integers between -32,767 and 32,767.	2 bytes
Long Integer	Integers between -2,147,483,647 and 2,147,483,647.	4 bytes
Numeric	A floating point number (whole or fractional) between 1.7 x 10E-308 and 1.7 x 10E308, with 15-digit precision	8 bytes
Date	Dates between 0 AD and 12/31/9999	8 bytes
Text	Variable-size alphanumeric character field	up to 55,000 bytes


Date Field

Only the following format can be used for entering dates from the keyboard:

mm/dd/yy	You must use the "/" separator

You can enter a partial form of the above format, and Ad Hoc will assume the rest based on the current (todays) date:

if you enter mm/dd, Ad Hoc will add the current year

if you enter a day number, Ad Hoc will add the current month and year

You can enter one of the following codes instead of a date.  You only need to enter the first three letters of each code.

Code	Converted to

today	current system date

yesterday	day before current system date

tomorrow	day after current system date

monday	date of the next Monday after current system date

tuesday	date of the next Tuesday

wednesday	date of the next Wednesday

thursday	date of the next Thursday

friday	date of the next Friday

saturday	date of the next Saturday

sunday	date of the next Sunday

Date formats for data exchange

Date output formats that can be specified for report and for data exchange are shown below using April 16, 1993 as an example.  Any of these formats can be specified for exporting.  Only the ones that are shown in boldface type can be used for importing.

Format code	Date displayed as

Default	4/16/93  (default format for Ad Hoc)

yymmdd	930416

yyyymmdd	19930416

mmddyy	041693

mmddyyyy	04161993

ddmmyy	160493

ddmmyyyy	16041993

mmm dd, yyyy	Apr 16, 1993

mmmm dd, yyyy	April 16, 1993

w, mmm dd, yyyy	Friday, Apr 16, 1993

dd mmm yyyy	16 Apr 1993


Validation Range Dialog

Use the Validation Range dialog to define the value range that will be used to validate the data entered into a field.

You can use Range validation for Character, Numeric (including integer), and Date data types.  You can enter a low value, high value, or both.  If you omit the high range value, the field value can be equal to or greater than the low value, and vice versa.


Validation Set Dialog

Use the Validation set Dialog to define the set of valid characters that are allowed in a field of type Character.  The values you enter can be either upper or lower case letters, digits, or punctuation.

Set validation if useful if a field is to contain a set of codes, such as days of the week.  In this case, the valid set might be MTWRFSU, each letter corresponding to a day of the week.  A valid field entry would be MWF.  MWA would be invalid.  Ad Hoc does not currently check for duplicates in the field, so MMWF would also be acceptable.

Case Sensitive

Check the Case Sensitive option if you want upper and lower case letters to be treated as separate characters.  If case sensitive is checked and the valid set is MTWRF, then MtWRF would not be valid.


Validation Codes Dialog

Use the Validation Codes dialog for fields with the Lookup validation type.  This dialog defines the valid values that can be entered into a field, along with an optional descriptive phrase that can be associated with the value.

The Validation Codes dialog contains a list of valid codes, or values, the field can have, followed by an optional description, a longer phrase that describes the code.  For example, a field in an employee record called SEX could have the following codes and descriptions:

Code	Description

F	female

M	male

The Code is the data in the field, the Description is supplied so that a user can understand the codes when entering data into the field.  The Description is optional for validation purposes.

To work with the validation codes dialog:

Click on	or Press	To

Add	Alt-A	Add a code to the list

Change	Alt-C	To change the description of a code in the list

Delete	Alt-D	To delete a code from the list

Shortcut:

Double-click on an entry in the code list to edit it

When you Add or Change a code, Ad Hoc displays the Edit Validation Code Dialog, enabling you to enter a code and description.

Code

A code can be any combination of letters (upper case) or digits, from one to sixteen characters.   You cannot define duplicate codes for a field.

Description

The code description is optional, and there is no practical limit to its length.


Edit Validation Code Dialog

The Edit Validation Code dialog is displayed when you add or change entries on the Validation Codes Dialog.

Code

A code can be any combination of letters (upper case) or digits, from one to sixteen characters.   You cannot define duplicate codes for a field.

Description

The code description is optional, and there is no practical limit to its length.


Define Index Dialog

See Also

Use the Define Index dialog to define an index for a table.  As indexes are added to the table definition, they are assigned a number, starting with 0, in the order you place them in the index list on the Database Table dialog.  Index 0 must be the primary key of the table.

A database table can have up to eight indexes, and each index can have up to eight segments.  However, the total number of segments in all indexes cannot exceed 24.  The total size of the segments in an index cannot exceed 255 bytes.

Dialog Entries

Name

Enter a descriptive name for the index that will help you identify it when selecting an index from a list.  You may want to use a phrase like "by Employee ID" or "Alphabetically".

Index Options

Option	Description

Modifiable	Fields that make up the segments of the index can be changed by the use after a record has been added to the table.  Example: if you index the employee table on last name, this allows you to change an employee's last name.

Duplicates Allowed	Records can have duplicate values for the fields that make up the index.  Example: if you index the employee table on last name, this allows two or more employees to have the same last name.

Nulls Allowed	Blanks (null values) are allowed for the fields that make up this index.  If the fields that make up an index are all blank, the record will not appear in the index (it will appear in other indexes).

Note:

The primary key index cannot have any of these options checked.

If a field belongs to an index that is not modifiable, it cannot be changed after the record is added to the table.

If a field belongs to an index that does not allow duplicates, no two records in the table can have the same value for this field.

Index Fields List

The Index Fields list contains the fields (index segments) that make up the index.

Table Fields List

The Table Fields list contains all the fields defined for the table that can be used as index segments.

To add a field to the Index Fields list

Double-click the left mouse button on the field in the Table Fields list, or

Click and hold the left mouse button on the field and drag it to the Index Fields list, or

Highlight the field in the Table Fields list and select Add

To insert a field in the Index Fields list

Click and hold the left mouse button on the field in the Table Fields list and drag it to the desired position in the Index Fields list, or

Highlight the field in the Table Fields list, highlight the field in the Index Fields list at the position you want to insert the new field, select Insert

To delete a field from the Index Fields list

Double-click the left mouse button on the field to delete in the Index Fields list, or

Highlight the field in the Index Fields list and select Delete

To rearrange the fields in the Index Fields list

Click and hold the left mouse button on a field and drag it to a new position in the list.

Case Sensitive Sort

To specify that the sort for an index field be case sensitive, check the CS option for that field in the Index Fields list.  You will not usually want to check this option.  Setting the case sensitive option means that lower case letters are arranged differently in the sort order than upper case letters.  The range (a-z) follows (A-Z), so that Zoo would come before albatross.  If the sort order is not case sensitive, upper and lower case letters are treated as identical (A and a are treated as equivalent).

Descending Sort Order

If you want a field to be sorted in descending order (e.g. from Z to A instead of A to Z), check the D option for that field in the Index Fields list.


Primary Keys and Indexes

Database Table Dialog

Designing Tables


Define Link Dialog
Table Link Dialog

See Also

Use the Table Link dialog to define the links, or relations, between two tables in the database.  In order to define a link from one table (the primary table) to another (the linked table), one or more fields in the primary table must comprise a foreign key for the linked table.  That means the field in the (or fields) must be equivalent to the field (or fields) that make up the primary key of the linked table.  Equivalency means the same data type and size.

When you add a table definition to your database, you should define all the links to other tables that make sense based on the meaning of your data fields.  Links enable you to develop multi-table forms and reports that contains fields from several different tables.

Links are also used to validate field values when you do data entry.  When a link is defined for a field, the linked table is used as a lookup table when you enter a value for the field on a form.

The Define Link dialog is displayed when you add or edit links for a table on the Database Table dialog. The dialog contains a list of all other tables defined in the data dictionary to which a link is possible based on the data type and size of the fields in the current table.  Not all of these potential links are meaningful.  You have to decide what links make sense based on the meaning and use of each field.  A good guideline to follow is to define a link to another table if it makes sense to use this table as a lookup table for the field (or fields) defining the link.

Link to Table

The Link to Table list contains all the other tables in the data dictionary whose primary key fields match fields in the current table.  As noted above, it may not make sense to define links to all of the tables listed.

Select the table for which the current link will be defined.

Note:  If this list is empty, there are no other tables in the database for which a link can be defined.  If you want to define a link for a field to another table for validation or lookup purposes, make sure that the field matches the primary key field of the other table in both data type and size.

Link ID

When you select a linked table, a suggested ID for the link is placed in the Link ID edit box.  You can replace this with any identifier you like.  Two links defined for the same table cannot have the same ID.

Link Name

When you select a linked table, a suggested name for the link is placed in the Link Name edit box.  You can replace this with any name that you like.

Fields in the Primary Key of <linked table>

On the left side of the dialog is a list of the fields in the primary key of the table you are linking to.

Matching Fields in <this table>

On the right side of the dialog, there is a combo box for each of the linked table fields shown on the left.  Each combo box contains a list of the fields from the current table (for which you are defining the link) that are potential matches based on data type and size.

Select the field in each combo box that you want to match up with the linked table field.  In most cases, there will be only one field from each table, as the primary key of a table usually contains only one field.

Again, the guideline in selecting the field on the right is to pick the field for which the linked table will be a lookup table when you do data entry.

Options

Click the Options button on the Table Link dialog to display the Link Options dialog.  Use this dialog to specify how the link will be used to enforce referential integrity.

Note:

In rare circumstances, you may need to use the same field in a table to define links to more than one table.  In this case, the first of these links as they appear in the tables list of links will be used to validate the field and will be used to define the lookup window.  Try to avoid using the same field in more than one link definition.


Table Links

Database Table Dialog

Designing Tables

Primary Keys and Indexes


Link Options Dialog

Use the Link Options dialog to set options for a table link.  Table links can be used to enforce referential integrity in the database, and you can select various referential integrity options related to a link on this dialog.

The referential integrity options in a link apply only when a record in the linked table is deleted, and affect only records in the current table (the table that contains the link definition).  The records in the current table are the dependent records, and the records in the linked table are the master records.

Note:  A link can be used for referential integrity checks only if the field that defines the link is also used to define an index in the current table.  The linked field must be the first field in the index field list, but there can be other fields listed after it.  If the link is based on more than one field, all the linked fields must be in the index definition in the same order they appear in the link definition.

If a link can be used for referential integrity, you can select the following options for the link:

Leave dependent records unchanged  Select this option to turn off referential integrity for this link.  When a record in the linked table is deleted, Ad Hoc will not look for dependent records.

Set fields in dependent records to null  You can select this option if none of the fields specified in the link have the Non-null values required attribute.  When you delete a record in the linked table, the field values in dependent records are set to null.

Delete dependent records  Select this option if you want all dependent records to be deleted when you delete a record in the linked table.

Cancel the deletion if there are dependent records  Select this option if you want to keep a record in the linked table from being deleted if there are dependent records.

Prompt if there are dependent records  Select this option if you want to be notified that there are dependent records when you delete a record in the linked table.  You can specify this option if you have selected the set fields to null or delete dependent records option above.  Whenever you delete a record in the linked table and there are dependent records defined by this link, Ad Hoc will ask you if you want to update or delete the dependent records.

Respond	To
YES	Update or delete the dependent records
NO	Leave the dependent records unchanged, but delete the master
CANCEL	Cancel the deletion of the master record
Note:  These options apply only to the dependent records defined by this link.  There may be other links that define dependent records in other tables.  If you select the prompt option for each of those links, you will be prompted for each set of dependent records.


Edit Database Information Dialog

See Also

Use the Edit Database Information dialog to define the characteristics of the database.

Description

Enter a long description of the database 1 to 32 letters or digits.  This helps identify the database in certain situations.  It can be changed if necessary.


Creating a Database

Designing a Database

Changing a Database


New Database Dialog

See Also

The New Database dialog is displayed when you select the Create New Database command.  It enables you to define the ID and directory of a new database.

Dialog Options

Database ID

Enter an identifier for the database.  The Database ID is a combination of one to seven letters (A-Z) and digits.  The ID is used to identify the data dictionary file of the database, the system files, and the reports, lists, and forms defined for the database.

Description

Enter a descriptive phrase up to 32 characters that describes the database.  You can change this description later with the Edit Database Information command.

Directory

Enter a directory into which the database system files will be placed.   Enter the full pathname of the directory, such as: C:\APP\DATA for a directory called DATA that will contain the database system files, which is a subdirectory of a directory called APP located on the C drive.

If the directory you specify does not exist, Ad Hoc will ask you if you want to create it.

Only one set of database system files can reside in a directory.

When you accept the entries in the New Database dialog, Ad Hoc will create a new set of system files and place them in the specified directory.

Browse

Click the Browse button to display the Browse Directories dialog.  This dialog works much like a standard Windows File Open dialog to help to locate a directory in which to place the new database.

Select a drive in the Drives drop down list

Select a subdirectory in the Directories list box

The files in the selected subdirectory are displayed in the Directory Contents list box

Select the All Files  option to see all files in the subdirectory

Select the Ad Hoc Files option to see only Ad Hoc system and table files in the selected subdirectory.


Report Elements Dialog

See Also

Use the Report Elements dialog to work with the elements in a report.

Click on	or Press	To

Add	Alt-A	Add a new element to the end of the elements list.

Insert	Alt-I	Insert a new element before the highlighted element in the list.

Edit	Alt-E	Change the description of the highlighted element in the list.

Delete	Alt-D	Remove the highlighted element from the list.

Cancel	ESC	Close Report Elements Dialog

Shortcut

Double-click on an element in the list to edit its definition.


Designing Reports

Designing Report Elements

Understanding Reports


Edit Element Dialog

See Also

Use the Edit Element dialog to change the definition of a report element.

Dialog Options

Name

Enter a descriptive name for the element, from one to 32 characters.

Trigger

Select the event during the printing of the report that will cause the element to be printed.

Region

Select the report region in which the element will be printed.

Page Break Options

When an element is printed, it can cause a new page to be started (a page break).  Elements assigned to the Page Header or Page Footer regions cannot cause page breaks.

Option	Description

None	The element will not cause a page break.

Before	A page break will happen before the element is printed.

After	A page break will happen after the element is printed.

Set Page to 1	When a page break caused by this element occurs, the page numbering will restart at 1.

Render on break	Selecting this option will cause an element to be printed at each page break , in addition to its assigned event.

Use this option, for example, if you want to repeat a break header element on every new page.

Fixed Size

Select this option if you want to specify an exact size of an element.  An example of an element that should have a fixed size is the image of a label on a report that prints mailing labels.  If you select this option you must specify:

Measurement	Description

Width	The width of the element.

Height	The height of the element.

Left Margin	The left margin within the element.  The distance between the left side of the element area and the start of text in the element.

Top Margin	The top margin of the element.  The distance between the top of the element area and the start of text in the element.

If you don't check the Fixed Size option, the width of the element will default to the distance between the left and right report margins.  The height of the element will be determined by the font height and the number of lines of text in the element, plus the top and bottom margin of the element.

Margins

The margins of an element are space between the borders of the element and text that appears in the element.  The margins are determined slightly differently, depending on whether you have selected the fixed size option or not.

For fixed size elements, the overall border of the element is fixed, and the margins determine the area available for text or other contents.

For non-fixed size elements, the left and right margins determine indents from the left and right report margins, and the top and bottom margins add extra space before or after an element:

Margin	Fixed Size Element	Non-fixed size
Left	The space between the left edge of the element and the text or other contents	Provides an indent from the left report margin
Right	The space between the element contents and its right edge	Provides an indent from the right report margin
Top	The space between the element contents and its right edge	Adds space before (above) the element
Bottom	The space between the element contents and its bottom edge	Adds extra space below (after) the element
Line Spacing

Select the spacing between lines of text in the element.

If you select	Then

Automatic	Lines will be spaced automatically by the size of the font of text in the line.

Set to...	You must specify a spacing between lines in points.  Specify the distance between the top of a line and the top of the next line.

Use Common Report Tabs

Select this option to attach the common tabs defined for the report to this element.  All elements with this option selected will share the same report tabs.  When you change a tab setting for one of these elements, you will change it for all of them.

Word Wrap

Normally, when an element is printed, it is truncated at the right margin of an element, and at the bottom margin if the element is fixed size.

If you check this option, lines within the element will be word wrapped, or broken at the last word boundary before the margin and the rest of the line printed on the next line of the report.  This is particularly useful in paragraph style reports, and when you have included Text fields, which can contain paragraphs of text, on a report.  Any remaining tabs in a line that is word-wrapped are applied against the next tab stop after the new line is started.  This may result in unwanted spacing if you are designing a columnar report.  For this reason, it is best not to place other fields after a Text field on a line, place Text fields on a separate line, or create a separate element for each text field.

If there are tabs in a Text field, they will be spaced according to the tab stops set for the element.

Note: There is an implicit option in Ad Hoc that could be called "Keep Together".  If word wrapping is not turned on, an element will be printed entirely on the same page.  If there is not enough room for a multi-line element at the bottom of a page, the entire element will appear at the top of the next page.  With the word-wrap option turned on for an element, the element is handled a line at a time, and the implicit "Keep Together" option is turned off.  Therefore, a page break could occur in the middle of an element.

Don't Print Blank Lines

Select this option to suppress the printing of blank lines in the element.  This is useful for printing address labels, for example, when you have several address lines.  Blank address lines will not show up on the label.

Filter

You can attach a filter to a report element to control under what conditions the element is printed on a report.  Defining a filter for an element is similar to designing a filter for a database view.  (See Filter Rules Dialog)  An element filter can be based on any of the fields defined for the report, including counter fields and computed fields.  If the rules of the filter are not met when it is time to print an element, the element is not printed.


Report Regions Dialog

See Also

Use the Report Regions dialog to work with the regions in a report.

Click on	or Press	To

Add	Alt-A	Add a new region to the end of the elements list.

Insert	Alt-I	Insert a new region before the highlighted region in the list.

Edit	Alt-E	Change the definition of the highlighted region in the list.

Delete	Alt-D	Remove the highlighted region from the list.

Cancel	ESC	Close Report Regions dialog

Shortcut

Double-click on a region in the list to edit its definition.


Designing Reports

Designing Report Regions

Designing Report Elements

Understanding Reports

Designing a Report Startup Dialog


Edit Report Region Dialog

See Also

Use the Edit Report Region dialog to change the definition of a report region.

Dialog Options

Name

Enter a one to 32 character descriptive name for the region.

Width

Specify the width of the region.  The width options are:

Option	Description

Report margins	The region will extend from the left margin of the report to the right margin.

Fixed width	The region will be the width you specify.

Width of fixed size elements	The region will be as wide as the sum of the widths of the elements assigned to the region that have been indicated as having a fixed size.

Height

Specify the height of the region.  The height options are:

Option	Description

Report margins	The region will extend from the top margin of the report to the bottom margin.

Fixed Height	The region will be the height you specify.

Height of  elements	The region will be as high as the sum of the heights of the elements assigned to the region.

Float between regions above and below	The region will extend from the bottom of the region that precedes it in the regions list to the top of the region that follows it.

Note:  Some of the height and width options are mutually exclusive and some depend on the options of other report regions.  See Designing Report Regions for examples of how to set region size options.

Horizontal Position

For some Region Width options, you must designate horizontal positioning of the region on the report layout.  When you select these Width options

Specify Width

Size Width to Contents

You must specify a distance (offset) of the region from the left or right report margin in inches.  A positive offset measures distance to the right of the left margin or to the left of the right margin.

Vertical Position

For some Region Height options, you must designate vertical positioning of the region on the report layout.  When you select these Height options

Specify Height

Size Height to Contents

You must specify a distance (offset) of the region from the top or bottom report margin in inches.  A positive offset measures distance below the top margin or above the bottom margin.

Repeat Direction

The elements assigned to a region are repeatedly printed in the region until it is filled.  For example, each time a record is read, an element assigned to the next record event is printed in its region.  Elements are repeated in a region according to the repeat direction option.

If you select	Then

One column	Elements are printed from top to bottom in the region, in only one column, regardless of the widths of the region and element.

By rows	Elements are repeated in rows and columns in the region, from right to left for each row, filling a row before going to the next.

By columns	Elements are repeated in rows and columns in the region, from top to bottom in a column, filling a column before going to the next.

The number of elements that fit across or down a region is determined by the size of the region and the size of the elements.  If there is not enough room either horizontally or vertically to print an element in a region, a page break occurs, which "empties" the report regions so they can be filled with new elements.

Border

If you want a border printed around a region

Select	To print

Left	a line on the left side of the region

Right	a line on the right side of the region

Top	a line along the top of the region

Bottom	a line along the bottom of the region

All	a border around the region

Border Style

Select the style of the borders that you want for the region.


Report Layout Dialog

See Also

Use the Report Layout dialog to define the general characteristics of a report.

Dialog Options

Report ID

Enter a unique ID for the report, from one to eight letters or digits, starting with a letter.  The report ID is used to store reports in the database Reports Table.  Two reports cannot have the same ID.

Name

Enter a descriptive name for the report, from one to 32 characters.  The name is used in report selection lists.

Startup Dialog

Select this option if the report will have a startup dialog.

Page Size

The page size is the physical size of the paper the report will be printed on.  Select the paper size for the report from the list of paper sizes.  This list contains:

All the standard paper sizes

Only the paper sizes supported by the currently selected printer, if the Show paper sizes for selected printer option is checked

If the paper size you want to use is not in the list, enter the width and height of the page using the Width and Height controls..

Printer Orientation

Select a printer orientation that will be used to print the report.

Orientation	Description

Portrait

Landscape

When you change the orientation, Ad Hoc assumes the physical paper size will remain the same and switches the page height and width measurements displayed in the controls.

Margins

Enter the Left, Right, Top, and Bottom page margins for the report, in inches.

Show paper sizes available on selected printer

Check this option if you want the paper size list to contain only the paper sizes supported by the currently selected printer.  Un-check this option of you want to see all standard paper sizes.  To change the currently selected printer, click the Printer Options button.

Fonts button

Click the Fonts button to display the Fonts dialog and change the fonts for the report.

Printer Options button

To set printer options for the report, click the Printer Options button to display the Printer Options dialog.  You can use this dialog to change the selected printer, or to specify printer options as part of the report design.  The printer settings you can save with the report are orientation and paper source (tray).

Apply print adjustments

If you are using a paper size not supported by your printer, Ad Hoc computes offsets to the position of the printed image on the page to compensate for the difference in sizes.  These offsets depend on the actual paper size vs. the size set in the printer and the orientation of the report.  If the offsets are not correct for a given situation, you can check the Apply print adjustments option for a report, then click the Adjustments button to display the Print Image Offsets dialog.  See Print Image Offsets Dialog for detailed help.

You can also specify horizontal and vertical offsets in inches to compensate for an overall misalignment of the printer paper feed.

For most applications, leave this option un-checked.

Adjustments button

Click this button to display the Print Image Offsets dialog to change print image offsets (see above).  This button is grayed if the Apply print adjustments option is not checked.


Label Report Layout Dialog

See Also

Label Measurements

The Label Report Layout dialog is a specialized report layout dialog for Label Reports.  This dialog is displayed when you create a new label report using the New command on the File menu, or select the Report Layout command on the Report menu.

Dialog Options

Report ID

Enter a unique ID for the report, from one to eight letters or digits, starting with a letter.  The report ID is used to store reports in the database Reports Table.  Two reports cannot have the same ID.

Name

Enter a descriptive name for the report, from one to 32 characters.  The name is displayed in report selection lists.

Startup Dialog

Select this option if the you want the report to have a startup dialog. report.

Label Style

Select Sheet to a display a list of sheet label styles for laser printers

Select Pin Feed to display a list of continuous form label styles for dot matrix and other tractor feed printers

The style list contains a number of pre-defined standard styles listed by Avery product number, plus custom styles that you can create and save in the database.

Select a style from this list.  This will be the default style for the report, but you can change the style on the report startup dialog just before you print the labels.

Label Margins

Specify the left and top margins within each label, in inches.  The label margins determine the distance of the text on the label from the left and top edges of the label.  You cannot set a right or bottom margin.  If the text is larger than the label, it will be clipped at the bottom and right edges.

Note:  Ad Hoc considers the horizontal and vertical pitch to be the width and height of the label element.  The actual right and bottom edges of a label are indicated by the right and bottom margins in the element edit window.

Print Direction

Specify whether you want the labels to be printed by rows or by columns.  You can change this on the report startup dialog before you print the labels.

Preview button

Click the Preview button to display the label preview window.  This window contains a picture of the label page for the selected label style.  If you design a custom label layout, it enables you to see how the label sheet will look.

Font button

Click the Font button to display the Fonts dialog, which enables you to select a font for the labels from the fonts installed on your computer.

Printer Options

Click the Printer Options button to specify printer options to be saved with the report.  The options you can specify for label reports are orientation (usually portrait) and paper source (tray).

Edit Style button

Click the Edit Style button to display the Label Style dialog.  Use the Label Style to design custom label layouts and optionally save custom styles in the Styles table.  See Report Styles.

Apply print adjustments

If you are using a paper size not supported by your printer, Ad Hoc computes offsets to the position of the printed image on the page to compensate for the difference in sizes.  These offsets depend on the actual paper size vs. the size set in the printer and the orientation of the report.  If the offsets are not correct for a given situation, you can check the Apply print adjustments option for a report, then click the Adjustments button to display the Print Image Offsets dialog.  See Print Image Offsets Dialog for detailed help.

You can also specify horizontal and vertical offsets in inches to compensate for an overall misalignment of the printer paper feed.

For most applications, leave this option un-checked.

Adjustments button

Click this button to display the Print Image Offsets dialog to change print image offsets (see above).  This button is grayed if the Apply print adjustments option is not checked.


Label Style Dialog

Use the Label Style dialog to select a label style from the Styles table or to design a custom label style for a label report.  This dialog is displayed when you select Edit Style on the Label Report Layout dialog.  The Label Style dialog has two uses: selecting a label style that will be part of the design of a label report, and saving a label style in the Styles table so it can be attached to other label reports.

Dialog Options

Sheet

Select the Sheet option to display a list of sheet label styles.  These styles are designed for laser printers and other sheet-feed printers.

Pin Feed

Select the Pin Feed option to display a list of pin-feed or continuous form labels styles.  These styles are designed for dot matrix printers.

Style

The Style list contains standard label styles and custom styles that you have saved in the Styles table.  The styles displayed depend on whether you have selected the Sheet or Pin Feed option.  The first entry in this list is designated untitled.  If you want to design a new label style, select untitled.  This turns on the label measurement controls.  Specify the label measurements.

If the style is only for the current report, you dont have to save it.  If you want to use this style for other reports, you can save it by selecting Save.  You will be prompted for a name for the new style.

Label Layout Measurements

The following dialog options are the measurements that describe a label style.  See Label Layout Measurements for a graphic explanation of these parameters.

Page Width
Page Height

Enter the width and height of a sheet of labels.  This is the physical size of the page in inches, to the nearest thousandth of an inch.  Most sheet label styles are for 8 1/2 x 11 inch sheets.  Page sizes for continuous form labels vary depending on the width of the label sheet and the pitch of the labels.

Left Margin
Top Margin

Enter the Left and Top, margins of the label sheet in inches.  The sheet margins are the distance between the edge of the sheet and the first label.  The bottom and right margins are set automatically based on the page size, number of labels and the pitch.

Labels Across

Enter the number of columns of labels on the sheet.

 Labels Down

Enter the number rows of labels on the sheet.

Horizontal Pitch

Enter the distance, in inches, between the left edge of one label and the left edge of the next label.

Vertical Pitch

Enter the distance, in inches, between the top edge of one label and the top edge of the label below it.

Label Width and Height

Enter the width and height of a label in inches.  If the labels touch each other on the page, the width and height will be the same as the horizontal and vertical pitch.

Auto Preview

Select the Auto Preview when you are designing a custom label and want to display the preview window and have it change each time a measurement is changed.

Preview button

Click the Preview button to display the label style preview window.  If the Auto Preview option is off, click this button to update the preview window after you have changed the layout measurements.

Save

Select Save to save a custom label style in the Styles table.  If you are saving a new custom style, Ad Hoc will prompt you for a name for the new style.

Delete

Select Delete to delete a custom style from the Styles table.  You cant delete the pre-defined styles.


Print Labels Dialog

When you print a label report that has a report startup dialog the startup dialog will contain a Layout button.  Selecting Layout will display a the Print Labels dialog that enables you to select a different label style or change other layout options for the current report.

Dialog Options

Label Style

Use the Label Style list to select a different label style than the one specified in the report design.

Label Left Margin
Label Top Margin

Allows you to change the internal margins of the labels, the distance between the edge of the label and the text.

Print by Rows

Select this option if you want the labels to be printed by rows on the label sheet.  This option applies only if the label layout contains more than one column of labels.

Print by Columns

Select this option if you want the labels to be printed by columns on the label sheet.  This option applies only if the label layout contains more than one column of labels.

Font

Select Font to display the Fonts dialog to change the font for the labels.

Preview

Select Preview to display the label preview window.  Use this if you change styles to confirm that the selected style is correct.


Envelope Report Layout Dialog

See Also

The Envelope Report Layout dialog is a specialized report layout dialog for Envelope Reports.  This dialog is displayed when you create a new envelope report using the New command on the File menu, or select the Report Layout command on the Report menu.

Dialog Options

Name

Enter a descriptive name for the report, from one to 32 characters.  The name is displayed in report selection lists.

Report ID

Enter a unique ID for the report, from one to eight letters or digits, starting with a letter.  The report ID is used to store reports in the database Reports Table.  Two reports cannot have the same ID.

Startup Dialog

Select this option if the you want the report to have a startup dialog.

Envelope Style

Select an envelope style from the list of styles saved in the styles table.  To create a new style, select Edit Style.

Address Options

The options for return address, delivery address, and message are specified on the Envelope Style dialog.  They are displayed, but cant be edited, on this dialog.  At print time, you can turn off any of the address options for the current printing, and change the settings of the POSTNET and FIM options.

POSTNET Code

Select this option if you want a POSTNET code to be printed on the envelopes.

FIM

Select this option if you want a Facing Identification Mark (FIM) to be printed on the envelopes.

Fonts buttons

Click the Fonts button to display the Fonts dialog and specify the fonts for the return address, delivery address, and optional message.

Edit Style button

Click the Style button to display the Envelope Style dialog.  Use the Envelope Style dialog to select an envelope style from the Styles table, or to design and save a custom style.

Printer Options

Click the Printer Options button to specify printer options to be saved with the report.  The options you can specify for label reports are orientation (usually portrait) and paper source (tray).

Apply print adjustments

If you are using a paper size not supported by your printer, Ad Hoc computes offsets to the position of the printed image on the page to compensate for the difference in sizes.  These offsets depend on the actual paper size vs. the size set in the printer and the orientation of the report.  If the offsets are not correct for a given situation, you can check the Apply print adjustments option for a report, then click the Adjustments button to display the Print Image Offsets dialog.  See Print Image Offsets Dialog for detailed help.

You can also specify horizontal and vertical offsets in inches to compensate for an overall misalignment of the printer paper feed.

For most applications, leave this option un-checked.

Adjustments button

Click this button to display the Print Image Offsets dialog to change print image offsets (see above).  This button is grayed if the Apply print adjustments option is not checked.


Envelope Style Dialog

Use the Envelope Style dialog to select an envelope style from the Styles table or to design a custom style for an envelope report.  This dialog is displayed when you select Style on the Envelope Report Layout dialog.  The Envelope Style dialog has two uses: selecting or creating a custom envelope style that will be part of the design of an envelope report, and saving an envelope style in the Styles table so it can be attached to other envelope reports.

Dialog Options

Style

The Style list contains envelope styles that you have saved in the Styles table.  The list also contains an entry designated untitled.  If you want to design a new envelope style, select the untitled entry, design the style, then select Save.  You will be prompted for a name for the new style.

Paper Size

The Paper Size list contains a number of standard envelope sizes.  If the size you want is not in the list, select the Custom Size entry, and use the Width and Height options to specify the envelope size.

Width
Height

Set the width and height of a custom envelope size.

Address Positions

You can select any combination of three address areas for the envelope and the horizontal and vertical position of each area on the envelope.  The position settings measure the upper left corner of each text area.  The size of the text area will depend upon the font you select and the number and length of the lines of text.

Check the option if you want it to appear on the envelope.  The standard use of each text area is:

Delivery Address	The main address on the envelope

Return Address	The return address of the sender

Message	An optional message or code to be printed on the envelope

Save button

If the style is to be used only with the current report, you dont have to save it.  To use a style with other reports, select Save to save the envelope style in the Styles table.  If the style is a new style, you will be prompted for a style name.

Delete button

Select Delete to delete a style saved in the Styles table.


Print Envelopes Dialog
K Print Envelopes Dialog

When you print an envelope report that has a report startup dialog the startup dialog will have a Layout button.  Selecting Layout will display Print Envelopes dialog that enables you to select a different envelope style, or make changes to the current style, for the current printing.

Dialog Options

Envelope Style

You can select a different style from this list from the styles saved in the Styles table.

Address Options

You can turn off any of the address / message options for the current printing (you cannot add options not specified in the style).

POSTNET Code

Select this option if you want a POSTNET code to be printed on the envelopes.

FIM

Select this option if you want a Facing Identification Mark (FIM) to be printed on the envelopes.

Fonts buttons

Click the Fonts buttons to display the Fonts dialog if you want to change fonts for the current printing of this report.


Report Style Changed Dialog

This dialog is displayed when you make changes to a report style that has previously been saved in the Styles table, but you have not saved the changes back into the Styles table.  You have three options:

Save changes to the style in the Styles table

Select this option, then select OK if you want the changes you have made to the report style to be saved in the Styles table.  This will affect all reports using this style.

Apply the changed style only to the current report

Select this option, then select OK if you want the changes you have made to the report style to affect only the current report.  Ad Hoc will change the name of the style to (untitled), indicating that it is not attached to a style in the Styles table.

Cancel

Select Cancel to return to the Styles dialog.


Quick Report Setup Dialog

See Also

The Quick Report Setup dialog helps you quickly set up the basic design of a standard report.  This dialog is displayed only once when you start a new report by selecting "Report(Quick Setup)" from the New command on the File menu.  Once the report is setup up, use the commands on the Report menu to make changes or further additions to the design of the report.

The Quick Report Setup dialog creates a standard style of report with:

A page header with a centered title and an area (report element) for column headings

An area (element) for the detail line description

An optional area (element) for a page footer with either the report date, page number, or both

Common tabs for the column heading element and detail line element

Border lines under the page header and above the page footer

Dialog Options

Title to Appear on Report

Enter the title to appear on the title line of the report.  This will appear centered at the top of each page of the report.

Date Option

If you select this option, the report will have a page footer element.  The print date of the report will be on the left of the footer line (bottom left corner of each page).

Page Number

If you select this option, the report will have a page footer element.  The page number will appear on the right side of the footer (lower right corner of each page).

Startup Dialog

Select this option if the report will have a startup dialog.

Name

Enter a descriptive name for the report, from one to 32 characters.  The name is displayed in report selection lists.

Report ID

Enter a unique ID for the report, from one to eight letters or digits, starting with a letter.  The report ID is used to store reports in the database Reports Table.  Two reports cannot have the same ID.


Report Columns Dialog

Use the Report Columns dialog to specify the columns to appear on a Quick Setup report.  This dialog is displayed in a sequence of dialogs during the creation of a quick report.

Report Column Fields List

Displays the fields selected from the data view that will be the columns of the report

Available Fields List

Displays the database fields that you defined on the Edit View dialog.

To add a field to the Report Column Fields list

Double click a field in the Available Fields list on the right to the end of the Report Column Fields list, or

Drag a field from the Available Fields list to the desired position in the Report Column Fields list, or

Highlight the field in the Available Fields list and select Add

To insert a field at a specified position in the Report Column Fields list

Click and hold the left mouse button on the field in the Available Fields list and drag it to the desired position in the Report Column Fields list, or

Highlight the field in the Available Fields list, highlight the field at the desired position in the Report Column Fields list, and select Insert

To delete a field from the Report Column Fields list

Double click the field you want to delete in the Report Column Fields list, or

Highlight the field in the Report Column Fields list and select Delete

To add all available fields to the Report Column Fields list

Select Add All

Drag the list entries to arrange the columns in the desired order

To re-arrange the fields in the Report Column Fields list

Click on a field and drag it to the desired position in the list

To remove all the fields from the Report Column Fields list

Select Delete All.

Data View

Select Data View to display the Data View dialog.  Use this command if you want to add more fields to the data view of the report as you decide on the columns to display.

The Quick Report setup will use the field titles from the database as the initial column headings, which you can change on the report design window.

The initial column tabs are based on the width of the column headings plus .5 inch.  This width will depend on the font you selected for the column headings.


Counter Field Dialog

See Also

Use the Counter Field dialog to define a counter field for a report.

Name of Counter Field

Enter a name for the counter field, of from 1 to 32 characters.

Field Being Counted

Select the designated "target" field in the report data view that the counter field will be attached to.  This field should a numeric data type if the counter field will be used for Sum, Average, Maximum, or Minimum.

Clear Counter on this Event

Select the report event that will cause the counter to be cleared, or reset to zero.  For a counter field that is to include all the records in a report, select the Report Header event to clear the counter field when the report starts.

Counter Type

The Counter Type option determines how the value of a counter field is changed each time a record is read from the report view while the report is being printed:

Counter Type	Action

Sum	The target field value is added to the value in the counter field.

Count	The value of the counter field is incremented by one.  If the Include Nulls option is not selected, target fields with null values are not counted.

Average	The value of the counter field is the average of the values of the target field in all the records read so far.  If the Include Nulls option is set, target field null values are counted as zero, otherwise they are not included in the average.

Maximum	The value in the counter field is the largest value of the target field in records read so far.

Minimum	The value in the counter field is the lowest value of the target field in records read so far.

Include Nulls

Select this option if you want the counter field results to include records for which the designated target field is null.  If this option is not set, null fields will not affect the results in a counter field.  If it is set, the field will be counted, but its value will be considered zero.  It will therefore affect Count and Average type counter fields.


Computed Field Dialog

See Also

Use the Computed Field dialog to define a computed field in a report.

Dialog Options

Name

Enter a name of from one to 32 characters that identifies the field.

Equivalent Field

The Equivalent Field list contains the database fields defined for the report.  Selecting one of these fields is a quick way of setting the field characteristics (Data Type, Edit Length, Decimal Places, and Case Control) of the computed field you are defining.

Select "-none-" if you want to define the characteristics of the computed field yourself.

Select a field ID from the list if you want to set the computed field characteristics equal to the selected field's characteristics.

Data Type

Select the data type of the field.

Edit Length

Select the number of characters the user is allowed to enter when entering a value for the field.   For Character fields, this is also the size of the field.  For numeric fields it determines the number of digits a user can enter.  The edit length is used if you place this field on a report startup dialog.

Decimal Places

Select the number of decimal positions a Numeric field will have when formatted for output.

Case Control

Select one of the following options:

Case Option	Description

None	The user can enter letters in either upper or lower case and digits.

Upper	All letters entered by the user are shifted to upper case.

Numeric	The user can only enter digits and the following punctuation characters: . / + -

Expression

Enter the expression that is used to compute the field value.  See Field Expressions.

Compute on Event

Select the event that will cause the field value to be computed according the field expression.  In the current version of Ad Hoc, field values are computed only when the report starts (Report Header Event), before the report startup dialog is displayed.  Therefore, the field expression can contain a suggested default value, and the user can override it when the report is started.


Field Expressions

The current version of Ad Hoc does not support field expressions except for constant values.  The constant value that you use for  a field expression must be compatible with the data type of the field.

Field expressions are specified on the Computed Field dialog.


Report Field Types

The types of report fields that can be defined for a report are:

Field Type	Description

Pre-defined Fields	Built-in report fields that include .Page, .Date, and .Time.

Database Fields	Database fields are fields defined in the report view (See Data View Command)..

Counter Fields	Counter fields, are used to count records in the report or to accumulate a running total of a database field.

Computed Fields	Computed fields are fields whose values are input by the user on the report startup dialog or are computed during the printing of the report.


Report Fields Dialog

Use the Report Fields dialog to select a field to be inserted on a report layout at the position of the blinking edit cursor.  This dialog is displayed when you select the Insert Field command.

The Report Fields dialog contains a list of all the fields defined for the report.  Below the list is displayed a description of the field selected in the list.  This description includes:

Field Type	Description includes

Standard Fields	Description of the field

Database Fields	The extended field ID from the report view

The field description from the data dictionary

Counter Fields	The computation type of the field

The database field whose value is being computed

Computed Fields	The characteristics of the field

The expression


Report Design Window Options Dialog

Use the Report Design Window Options Dialog to set display options for a report design window.  You can display this dialog by selecting the Options command on the Report menu when a report design window is active, or clicking the right mouse button on the report design window zoom control.

Dialog Options

Display Fields As

Select the way fields are displayed in the layout in a report design window in either edit or page mode.  Fields are shown highlighted with a gray background.

Option	Fields shown as
Extended ID	The extended ID  of the field used in the report data view
Short ID	The field ID as defined in the table.  If the field is from a linked table, a + is displayed after the ID
Name	The name of the field as defined in the table.
Sample Data	The value of the field from the first record of the reports data view.
Show Tabs

Select this option if you want a symbol for tabs to be displayed in edit and page modes.

Show Element Borders

Select this option to display a border around each element edit window in edit mode.

Show Element Margins

Select this option if you want a dotted line to be displayed for non-zero element margins (margins defined within each report element).


Report Display Window Options Dialog

Use the Report Display Window Options dialog to change the viewing and other options for report display windows.  You can display this dialog by selecting the Options command on the Report menu or clicking the right mouse button on the zoom control of a report display window or report design window in preview mode.

Dialog Options

Report Page Height

There are two options for report page height:

Select	To

As Designed	Generate the report with a page height equal to that specified when the report was designed.

Fit Window	Change the height of the report page to equal the height of the display area of the report display window.  The height of the window when the report generation starts is used.  If you subsequently change the window size, the page size of an already generated report is not changed.  If you change this option after the report is generated, you have to use the Restart command to regenerate the report with a new page size.

Magnification

The magnification options set the scaling of the report in the display window.  Using a smaller magnification zooms out so that more of the report is visible in the same area.  Using a larger magnification zooms in so that the output of the report looks larger, but you see less of it.

Select	To

Fit Window	Set the magnification so that an entire page of the report can fit within the report display window.  This option is not available if you have set the "Fit Window" Page Height option.

Custom	Specify the magnification amount, from 10 percent to 200 percent.

Store Pages on Disk

As a report is generated, the image of each page is stored in memory.  Each page image could require 5,000 to 6,000 bytes for moderately complex pages of text, and possibly more for very complex output.  If you have a large report to view, and limited RAM in your computer, you can select the Store Pages on Disk option to store the page images in temporary files on disk rather than in memory.  Each page is stored in a temporary file with a name like: ~MFxxxx.TMP.  These files are stored   If you have a TEMP environment variable specified, these files will be placed in the directory specified in that environment variable, otherwise they will be placed in your Windows directory.  When the report display window is closed, or a new report is generated, these temporary files are removed.  Don't select this option for the fastest report generation and display speed.


Report Selection Dialog

Use the Report Selection dialog to select a report from the database.  Use the up and down arrow keys to highlight the desired selection, or just click on it with the mouse.  Then press the Enter key, click the OK button, or double-click the left mouse button to select the highlighted entry.

The list box in this dialog is an Ad Hoc list, which means that you can use Ad Hoc keystroke navigation to highlight an entry.


Send Report to File Dialog

Use this dialog to send the output of a report to a text file.

Dialog Options

File Name

Enter the pathname of the output file.  If the file exists, Ad Hoc will notify you and ask if you want to overwrite it.  If you respond yes, the existing file will be replaced by the new text file.

Browse

Displays a File Open dialog to help you select a path and name for the output file.  The pathname you select will be placed in the File Name edit box.

Fill Tabs with Spaces

Select this option to replace tab characters in the report with space characters.  Each tab will be replaced with the number of spaces necessary to reach the next tab stop in the text line.

If this option is not selected, the tab characters will be put into the text file.

Tab Stops

If you select the Fill Tabs with Spaces option, Ad Hoc assumes equally spaced tab stops separated by the number of characters you specify with this option.

OK

Select OK to proceed with the report output.

Cancel

Select Cancel to cancel the report output.


Tables Window

See Also	Procedures

The Tables Window displays a list of the tables defined for the current database.  The tables are displayed alphabetically by Table ID.  This list also displays the description of the table, its file status, and the number of records in the table.  When the Tables Window is displayed, you can use the commands on the Tables menu to change table definitions and maintain table files.  Some of these commands also appear on the Table Window fast menu, that pops up when you press the right mouse button when the cursor is over the Tables Window.

Note: to use the fast menu, first select the table you want to work with by pressing the left mouse button, then press the right button.  The right button will not change the table selection.

You cannot edit or rebuild tables while a form, list, or report window is open on the desktop.

The file status of a table displayed in the Tables Window is one of the following:

Status	Meaning

OK	The file exists and its status is normal.

No File	The file could not be found.  Ad Hoc looks for a file with the name specified in the table definition.  If there is no pathname specified in the table definition, Ad Hoc assumes the file is in the directory assigned to the database when it was created.  This is the current working directory when the database is opened.

Error in File	An error was encountered in opening the file.  The file must either be rebuilt, or if that is not possible, restored from a backup.  If all files contain this error code, there is a system problem.  In this case, before rebuilding, first close all your applications, reboot your system, and open Ad Hoc again.

The tables containing  data in the database are shown in black.  System tables are shown in blue.  If the table file could not be found, the table is displayed in red.


System Tables

The system tables are the standard tables included in every Ad Hoc database you create.  They are described in the table below.  These tables are stored in the system files that make up the data dictionary of the database.

Table ID	Description

_DDDATA	Contains data dictionary information, including validation rules for database fields.

_FORMS	Contains form and list designs, and saved desktop layouts.

_REPORTS	Contains report designs.

_STYLES	Contains report styles.  There is only one copy of this table, available to all databases, located in the Ad Hoc program directory.


Creating a New Database

Designing a Database

Changing a Database Design

Adding Tables

Designing a New Table

Editing Table Definition Command

Database Maintenance

Understanding Databases


The title bar of the Tables Window displays the pathname/id of the database.  (this is the same as the pathname/filename of the data dictionary file, minus the .ddf suffix).


The ID column displays the ID of the database tables.  The tables are sorted in the list by ID.


The Description column displays the Description of the database tables entered on the Database Table dialog.


The Status column shows the file status of each database table.


The Records columns shows the number of records in each database table.  For the _FORMS table, this is the number of forms, lists, and desktop layouts stored in the file.  For the _REPORTS table, it is the number of report designs.


Forms

Form Window

Form Control Pad

Using Forms

Displaying Forms

Entering Data on a Form

Using a Form Scroll Region

Using a Form Search Window

Using Lookup Windows

Designing Forms

Attaching a Report to a Form


The Form Window
Form Window

See Also	Procedures

Click on an object in the above graphic to view a short description.


Using Forms

Displaying Forms

Entering Data on a Form

Using a Form Scroll Region

Using a Form Search Window

Changing the Record Selection Filter

Attaching a Report to a Form

Designing Forms


Using Forms

A form is a desktop object that displays fields from the database one record at a time in a layout format similar to a paper form.  A form is used to enter and change data in the database as well as view it in a custom format.  A form contains objects called controls that display the contents of data fields.

Control Type	Description

Edit Box	A one-line control for entering and editing fields of type.

Text Box	A text box can contain more than one line of text, and is used to display and edit fields of type Text.

Combo Box	Similar to a Windows dialog combo box.

Check Box	Similar to a Windows dialog check box.

Frame	A border with optional title used to frame an area on a form.  Can also be used for horizontal and vertical dividing lines or to place text on the form.

Button	Similar to a button control on a Windows dialog.  You can put custom buttons on a form that duplicate the commands available on the form menu or control pad.

Each form control, except for frames and buttons, corresponds to a field in the data view associated with the form, and when you change the information in the control and then accept the change, you have changed the field in the database.  If you discard the changes you make on a form, the changes are not made in the database.

See	For help on

Form Window	An overview of  a form and its various components

Displaying Forms	Displaying and putting away forms

Entering data on a form	Making changes to the data displayed on a form

Using a Form Scroll Region	Working with forms that contain scroll regions

Using a Form Search Window	Selecting a record from the data view to display on a form


Displaying Forms

To open a form and display it on the desktop:

1.	Select the Open command on the File menu to display the Open dialog.

2.	Highlight the name of the form you want to open, by clicking it or using the up or down arrow to highlight it.

3.	Click the OK button, or press ENTER.

You can also just double-click on the name of the form to open it.

To put away a form

Make sure the form is the active form.  Then do one of the following:

Select the Close command on the File menu.

Double-click the system menu icon in the top left corner of the form.

Click the system menu icon to display the menu, the select the Close command.

To close all the open forms (and other desktop objects), select the Close All command on the Window menu.


Form Control Pad

See Also:  Form Design Control Pad

The form's control pad is displayed at the top of the form.  The control pad contains icons representing control functions for the form.  When you click the left mouse button on an icon, it sends a command to the form.  Some of these icons may not appear, depending on the status of the form.

Click on an icon in the above graphic to view its function, alternate keystroke command, and alternate menu command.


First Record

Click this icon on a form control pad to display the first record from the form's data view.  The first record is determined by the current index selected in the search window, or the current sort order.

Keystroke Equivalent:	Ctrl-F

Form menu command:	First


Previous Record

Click this icon on a form control pad to display the previous record from the form's data view.  The record order is determined by the current index selected in the search window, or the current sort order.  If you hold the left mouse button down on this icon, the Previous command will start repeating until you release the mouse button.

Keystroke Equivalent:	Ctrl-P

Form menu command:	Previous


Next Record

Click this icon on a form control pad to display the next record from the form's data view.  The record order is determined by the current index selected in the search window, or the current sort order.  If you hold the left mouse button down on this icon, the Next command will start repeating until you release the mouse button.

Keystroke Equivalent:	Ctrl-N

Form menu command:	Next


Last Record

Click this icon on a form control pad to display the last record from the form's data view.  The last record is determined by the current index  selected in the search window, or the current sort order.

Keystroke Equivalent:	Ctrl-L

Form menu command:	Last


Search for a Record

Click this icon on a form control pad to display the search window.  If no search window has been defined for the form, this icon will not appear on the control pad.

Keystroke Equivalent:	Ctrl-S

Form menu command:	Search


New Record

Click this icon on a form control pad to prepare the form for entering a new record in the database.  If the form does not allow the entry of new records, this icon will not appear.  It also does not appear when the form is in design mode.

Keystroke Equivalent:	Ins (Insert key on the keypad)

Form menu command:	New


Delete Record

Click this icon on a form control pad to delete the current record.  Ad Hoc will ask you to confirm the deletion.  If the form does not allow deletion of records, this icon will not appear.  It also does not appear when the form is in design mode.

Keystroke Equivalent:	Ctrl-D

Form menu command:	Delete


Update Record Changes

Click this icon on a form control pad to accept the changes you have made on the form.  This icon appears if a change has been made on the form.

Keystroke Equivalent:	Enter key

Form menu command:	Update


Cancel Record Changes

Click this icon on a form control pad to discard the changes you have made on the form.  The record will not be updated and the form will be restored to its values before you began the changes.

Keystroke Equivalent:	Esc key

Form menu command:	Cancel


Lookup Field Value

This icon appears when the form control (field) with the current focus has a value that can be looked up in another table or has a validation rule defined in the data dictionary.  Click this icon to open the lookup window and select a value for the field.

You can also click the right mouse button in the data area of the control to view the lookup window.

Keystroke Equivalent:	Ctrl-<up> (hold the Ctrl key down and press the up arrow key)

Form menu command:	none


Set Filter

Click the icon to display the Filter Rules dialog and view or change the record selection filter attached to the form (or list).

Keystroke Equivalent:	none

Form menu command:	Filter


Print Record

This icon appears when a report or list is attached to the form.  Select Print Record to add the current record to the report.

Keystroke Equivalent:	F8

Form menu command:	Print Record


New Page

This icon appears when a report attached to a form or list is open (the first record has been printed).  Select New Page to start a new report page  by sending the printer a form feed command..

Keystroke Equivalent:	Ctrl-F8

Form menu command:	New Page


Close Report

This icon appears when a report attached to a form or list is open (the first record has been printed).  Select Close Report to close the report and terminate the print job.

Keystroke Equivalent:	none

Form menu command:	Attach | Close Report


The form title bar displays the name of the form.  You can click and drag the title bar to move the form on the desktop.

When a form is in design mode, the word "Design" precedes the name of the form.  When a form is sorting, or linked to another form, that is also indicated in the title bar.


Entering Data on a Form

To edit (make changes to) a record in the database

To edit a record in the database, make sure the correct record is displayed on the form:

Use the search window to find the record, or use the Next Record or Previous Record commands to locate the record.

 Move to the control that contains the data you want to change.  You can do this by:

Pressing the Tab key to move from one control to the next

Pressing Shift-Tab to move backwards from one control to the next

Click the left mouse button on the control

Edit boxes and text boxes

To make a change to an edit box or a text box, position the cursor in the control at the point in the text where you want to make the change, then type in your change.

Press the backspace key to delete the character to the left of the cursor

Press the Del key to delete the character to the right of the cursor

Hold down the left mouse button and drag the mouse across a selection of the text you want to highlight.  When a selection is highlighted, the next character you type will replace the highlight (the backspace and Del keys will delete a selection).

When you enter a change on a form, the update and cancel icons will appear on the control pad.  Change as many data items as you want, then press the Enter key or click on the update icon to accept your changes and update the information in the database.  To discard your changes, press the Esc key, or click on the cancel icon.

Some edit boxes have lookup windows that you can use to select a value and enter it into the control.  See Using Lookup Windows.

For edit boxes attached to fields with Date data type, there are a number of ways for entering dates.  See Date Field.

Invalid entries

Ad Hoc can use field validation rules in the data dictionary and table links to validate the contents of some controls.  As you leave a control on a form (either by tabbing or clicking the mouse on another control) Ad Hoc will validate the contents of a control.  If there is an error, Ad Hoc will beep and display an error message.  You can set an option on the Confirmation Options tab of the Options dialog to require that the contents of a control be valid before you can move the focus away.  If this option is not set, you can move to other controls if the entry is invalid, but all controls must be valid before a record can be updated.

Line breaks and tabs in text boxes

Since the Tab key is used to move the input focus on  a form, it cannot be used to insert a tab character in a text box.

To insert a tab character in a text box, hold the Ctrl key down and press Tab

When the input focus is in a text box, pressing the ENTER key will begin a new line of text (instead of the normal action of accepting the changes on the form).  If the focus is in a text box, you can use the control pad to update the record, or you can tab out of the text box and then press ENTER.

Combo boxes

Instead of typing data into a combo box, you select a value from a list of values in the combo box.  A combo box normally displays the selected value of the field.  To see the list of values and select a new value, you display the drop down list of the combo box.

To select a value from the combo box list,

Click the arrow icon on the combo box to display the list, then click on the desired entry.

Type the first letter of a value in the list to select it.  The list does not have to be displayed.  If several entries have the same first letter, successively typing the letter will select the items in order.

For fields that are required (not allowed to be blank) the combo box contains only the list of valid values.  For fields that can be blank (have null values), there is an extra entry in the list designated as "n/a".  This corresponds to a null value, and selecting this entry in a combo box is the same as leaving an Edit box blank.

Accepting the changes

When you try to leave a form control, either by tabbing, clicking on another control, or accepting the changes to the form, Ad Hoc will validate the contents of the control.  If the information you entered into the box is invalid, Ad Hoc will not let you leave the control.  Instead it will beep and display a message in the status bar.  If this happens, simply retype your entry with a valid value for the field.

To add a new record on a form

1.	Use the New Record command to blank the form.

2.	Enter the field values for the new record

3.	Accept the new record with the Update Record Changes command

To discard the new record without adding it to the database, use the Cancel Record Changes command.

You can add a new record on a form only if the Add permission was specified in the form design and all the required fields in the primary table of the form's data view are on the form.  For new record to be accepted, the field or fields that make up the primary key of the primary table must not duplicate the key of a record already in the table.

To delete a record

Make sure the form is displaying the correct record, then use the Delete Record command to delete the record.  Ad Hoc will ask you to confirm the deletion.  You can delete records on a form only if the Delete permission was specified in the form design.


Using a Form Scroll Region

A scroll region is an area on a form that contains an imbedded list.  This list operates like a standard list object (See Using Lists), except that its data view is usually linked to the parent form so that the records displayed in the list have some relationship to the records on the parent form.

When a form with one or more scroll regions is first displayed, the form is active, which means that pressing the Tab key will move you from control to control on the form.

To activate the scroll region

Press the F6 key to activate a scroll region, or click on the scroll region with the mouse.  When a scroll region is active, pressing the Tab key will move the input focus among the controls of the scroll region.

Successively pressing F6 will move the active focus between the scroll regions and the form.  You can also reactive the form by clicking on any control on the form (except scroll regions and display-only controls).

Editing records displayed in the scroll region

If the scroll region has a pop-up edit form (see Using Lists), you can use the following commands when the scroll region is active:

To	Do this

Add a new record	Press Alt-A, or
Click the left mouse button on the Add button

Edit a record	Highlight the record in the list by clicking on it or using the arrow keys, then
Press Alt-E, or
Click the left mouse button on the Edit button, or
Double-click on the record in the list

Delete a record	Highlight the record in the list, then
Press Alt-D, or
Click the left mouse button on the Delete button
Ad Hoc will ask you to confirm the deletion


Using a Form Search Window

The search window of a form is a list attached to the form that pops up to display the records from the form's data view in a list (row and column) format.  You can use the search window to browse through the records and select a record to load into the form for editing.

If the form has a search window, you can use the search icon on the control pad to display the search window.

Click on an area of the above graphic to see a short definition.

Selecting a Record from a Search Window

To select a record from the search window, click on the entry in the search list, or use the arrow keys to highlight the entry.  Then click the OK button or press the ENTER key.  You can also just double-click on the entry to select a record.  The search window will close and the selected record will be displayed on the form.

If you want to close the search window without selecting a record, click the Cancel button, or press the ESC key.

Changing the order of records in the search window

Use the sort control at the top of the search window is a combo box that enables you to select the sort order of records in the list.  To display the drop-down list of the combo box, click on the combo box.  Select the sort order displayed.  The entries in the sort list will include:

All the indexes defined for the primary table of the data view.  Each of these entries will include the index number and description.

The sort defined for the data view, if one was defined.  This entry will include the IDs of the fields in the sort specification, if one was defined for the form's data view.

When you select a sort, the names of the fields that define the sort will be displayed after the search control (see below).

Searching for a Record

You can use the search control on the search window to search for a particular record in the list.  See List Search Control for help.  When you have found (and highlighted) the record you want to edit,  press ENTER or click the OK button to hide the search window.  The record will be displayed in the form.  If you do not want to select a record from the search window, click the Cancel button or press the Esc key.


Click the OK button (or press the ENTER key) to select the record highlighted in the list and display it in the form for editing.


Click the Cancel button (or press the ESC key) to close the search window without selecting  record.


Using Lookup Windows

A lookup window is a window attached to certain edit boxes on a form to help you select a value and enter it.  A control has a lookup window if the field it is attached to:

is used to define a link to another table

has been defined with validation rules in the data dictionary

is a date field (data type is Date)

When you move the input focus to a control with a lookup window, you will see the lookup icon shown above on the control pad.  To display the lookup window

Click the lookup icon

Click the right mouse button on the data entry area of the control

hold the Ctrl key down and press the up arrow key

Table Lookup Windows

A table lookup window is attached to a control if its field is used to define a link to another table.  (See Table Links for a description of links between tables.)  The linked table defined in the link is the lookup table for the controls field, and the valid values for the field are the values of the primary key field in the records of the lookup table.  When the term lookup window is used throughout the documentation, it generally refers to a table lookup window.  The term lookup list is also used because a table lookup window is a type of list, similar to a form search window.

You use a table lookup window the same way as other lists, and you can design a lookup window to change its appearance or the data it displays.

 For help on using a table lookup window, see Using Lists

 For help on designing a lookup window, see Designing Lookup Windows

To select an entry from a lookup window, highlight the desired entry and either click the OK button or press ENTER or just double-click the entry.  The values from the selected record in the lookup table will be entered into the field being edited and any other fields from the lookup table that may be displayed on the form.

If you don't want to select an entry, click the Cancel button or press ESC.

When you use a lookup window for the first time after opening a form, it will have the size you gave it in design mode. You can re-size it by dragging its border with the mouse.  It will retain this size until the form is closed.  The sort order of the lookup window will initially be index selected when you last saved the form, but you can change the sort order like any other list.

Other Types of Lookup Windows

The lookup icon is also displayed for fields that have validation rules defined in the data dictionary.  The lookup windows for these fields are dialogs that depend on the validation type:

Validation type	Description

Lookup	Displays a list of the valid values and their descriptions from the data dictionary.  Selection of a value is similar to a table lookup window.  For fields of this type, you can also use a combo box control instead of an edit box with a lookup window.

Set	Displays the valid characters only, you must enter the field value.  If the field has a length of one and no more than one or two valid character values in the set, consider using a check box control instead of an edit box.

Range	Displays the valid range of values, you must enter the field value

Calendar Lookup Window

For date fields, you can display a calendar lookup window to specify and enter a date.  See Calendar Lookup Window.


Changing the Record Selection Filter

You can change the record selection filter attached to the data view of a form or list by selecting the Filter command on the forms (or lists) fast menu when it is in run mode.  This command displays the Filter Rules dialog, where you can view or change the forms current filter.  Changes you make to the record filter this way are not stored permanently with the design of the form or list unless you subsequently select the Save command on the File menu to save the design.

When there is a filter attached to the data view, or the form (list) is linked to another form or list, the Filter command on the fast menu will be checked.  On a form, you can also click the [image] icon on the control pad.  This icon is shown highlighted if there is a filter defined for the view.


Linking Forms on the Desktop

Examples

You can link forms or lists open on the desktop so that when you view a record on one form it determines the records that can be viewed in the linked form.  The controlling form (or list) is called the master and the form or list linked to it is called the slave.  You define a link between two forms or lists by defining matching fields in the data views of the two forms.  This creates, in effect, a filter for the slave form or list.  The slave form or list can display only records with link fields that match (equal) the corresponding link fields in the master.

If the slave form already has a filter defined in its data view, the effects of the link filter are added to it.  For example, you can link a slave employee list to a master department form, and additionally filter the employee list for employees hired after a date.

Creating Form Links

Use the Form Links command on the File menu or the Form menu of the master form,  The master form must be the active form when you define the link, and the slave form must be open on the desktop.

See Form Links Dialog and Edit Link Dialog for help on describing the link.

Procedures:

Link a form to another

Unlink a form from another

Saving Form Links

Form links are saved when a desktop layout is saved.


Examples of linking forms and lists
Examples of linking forms and lists on the desktop

Examples of linking forms that you can try with the sample database that came with Ad Hoc:

Linking a list to a form

Linking a form to a list

Linking a form to another form


Linking a form to a list

You are editing department records on the Department Master form, and when a department record is viewed on this form, you want to see a list of phone numbers for the employees in this department.

Open the Employee Phone List list.

On the Department Master form, use the Form Links command to link it as the master to the Employee Phone list as the slave, by matching the DEPT field of the Employee Phone List to the DEPTID field of the Department Master form.

When you view a record in the Department Master form, only employees from that department will appear in the Employee Phone List


Linking a list to a form

You are viewing records on the Employee List, you want to see information on each employee's department.

Open the Department Master form

On the Employee List, use the Form Links command to link it as the master to the Department Master form as the slave, by matching the DEPTID field of the Department form to the DEPT field of the Employee List.

When you highlight an entry in the Employee List, that employee's department record is displayed on the Department form.

(Note: "Master" in the department form name means "the master record of department information", and is not related to the term "master form of a link")


Linking a form to a form

You are editing information on the Employees form, and at the same time want to edit employee address information, which appears on the Employee Home Addresses form.

Open the Employee Home Addresses form.

On the Employees form, use the Form Links command to link it as the master to the Employee Home Addresses form as the slave, by matching the EMPID field of the Employee Home Addresses form to the EMPID field of the Employees form.

When you view a record on the Employees form, the address record for the same employee will appear on the Employee Home Addresses form.


Attaching a Report to a Form

Reports designed and stored in the Reports table can be attached to a form or to a list.  The same procedures discussed below for forms apply to lists.

When a report is attached to a form, it doesnt sequence through the records of a view and print a line or page for each record.  Instead, it prints the information only for the records that you select.  When you want to include a record on the report, display the record on the form (select its entry on the list) and then select the Print Record command on the Form (List) menu.  The record will be added to the report output according to the way you designed the report.

An attached report can be used for a number of purposes:

Print a page containing the information displayed on the form (a sophisticated screen dump

Print a form letter, label, or envelope for the selected record

Use a list to manually select the records that will be printed on a report

Restrictions

A report can be attached to a form only if the primary table of its view matches the primary table of the form.  The information displayed on the form does not have to be the same as the information printed on the report.  The current record displayed on the form is used only to determine the record in the report view that will be printed.  You can design the report to contain the same fields, or completely different fields.

Since you are selecting the records, the sort specification and filter defined for the report are ignored, and level break processing is not done.  In all other respects, the report output will look as you designed it.

Designing an attached report

See Designing Reports for help on designing a report.

Once a report has been attached to the form, you can use the Design Attached Report command on the Attach Report sub-menu of the Form Menu to open a report design window for making changes to the report design.

To attach a report

Select the Attach Report command on the Form Menu (or List Menu) to display the Attached Report dialog.

Use the Select button on the dialog to display a list of reports.

Select a report that has the same primary table as the form.  (The dialog wont accept other reports.)

Set the desired options on the Attached Reports dialog, then select OK.

Report icons

When a report is attached to a form, a printer icon appears on the control pad.  While a report is active, two more icons appear on the control pad.

Icon	Menu Command	Description

Print Record	Appears if a report is attached.  Prints the current record

New Page	Sends a form feed command to the printer

Close Report	Terminates the report and the print job

To print a record

The report is not opened (started) until you print the first record after attaching the report.  At that time, a print job is opened (if you are using the Print Manager) or the printer is initialized for the report (if you are not using the Print Manager or other print spooler).

To print the currently selected record on a form or list, select the Print Record command on the Form (List) menu.  On a form, you can also click the printer icon.  If you did not select the Keep Open option on the Attached Report dialog, the report is closed (the print job is ended) after the record is printed.  See Attached Report Dialog for details on the Keep Open option and the automatic print options.

To start a new page

Select the New Page command on the Form or list menu, or click the New Page icon.

To close the report

To end the report and the print job, select the Close Report command on the Attach Report sub-menu on the Form or List menu, or click the Close Report icon.

To detach a report from a form

Select the Attach Report command on the Form (List) menu to display the Attached Report dialog., select Clear on the dialog, then select OK.

To save the attached report options with the form design

The Attached Report commands appear only on the Form or List (run mode) Menus and not on the design menus.  If you want to save attached report options with the form design:

Leave design mode

Before saving the form, attach the report and select the options you want to save

Select the Save command on the File Menu


Form Design Window

See Also 	Procedures

Click on areas in the below picture of a form in design mode for brief explanations.


Search Icon

Click this icon when the form is in design mode to display and design the search window.  A search window is designed just like a desktop list.


An edit box click the right mouse button on a form control in design mode to display the control attributes dialog.


A selected control has a dotted selection rectangle displayed around the data entry area of the control and the title.  Click anywhere in this area with the left mouse button to select the control and drag it with the mouse.  Click the right mouse button to display the attributes dialog.


A scroll region with an embedded list.  Click the right mouse button on the list to display its design menu.  An embedded list is designed just like a desktop list or search window.


List scroll bar.  Click and drag the left mouse button on the tabs to change the column positions.  Click the right mouse button on the tabs to display the tab menu to change the tab alignment type.


List Edit button.  If the list has a pop-up edit form, the Add, Edit, and Delete buttons will appear.  Click on the Edit button (or Add if it is not grayed) to display the pop-up edit form for design.  The design of an pop-up form layout is like the design of a desktop form.


Align Left

Aligns the selected controls in the horizontal direction so that the left edges of their data entry areas are lined up vertically.  Titles are ignored for the alignment.


Align Right

Aligns the selected controls in the horizontal direction so that the right edges of their data entry areas are lined up vertically.


Align Top

Aligns the selected controls in the vertical direction so that the top edges of their data entry areas are lined up horizontally.


Align Bottom

Aligns the selected controls in the vertical direction so that the bottom edges of their data entry areas are lined up horizontally.


Align Centers Horizontally

Aligns the selected controls in the horizontal direction so that the centers of their data entry areas are lined up.  The widest control is used as a reference and is not moved.  All other controls are moved horizontally to align with the widest.  If other controls are the same width as the widest, the first control selected is used.


Align Centers Vertically

Aligns the selected controls in the vertical direction so that the centers of their data entry areas are lined up. The tallest control is used as a reference and is not moved.  All other controls are moved vertically to align with the tallest.  If other controls are the same height as the tallest, the first control selected is used.


Space Equally Vertically

Moves the controls vertically so that they have equal spacing between them in the vertical direction.  The top and bottom controls in the selection are not moved.


Space Equally Horizontally

Moves the controls horizontally so that  they have equal spacing in the horizontal direction.  The leftmost and rightmost controls in the selection are not moved.


Grow to Largest Width

Re-sizes the selected controls to the width of the widest control in the selection.


Shrink to Smallest Width

Re-sizes the selected controls to the width of the control with the smallest width in the selection.


Grow to Largest Height

Re-sizes the selected controls to the height of the control with the largest height in the selection.


Shrink to Smallest Height

Re-sizes the selected controls to the height of the control with the smallest height in the selection.


Center in Form Horizontally

Moves the selected control or controls so that they are centered in the form horizontally.  The rectangle that encloses all selected controls, including their titles, is centered.


Center in Form Vertically

Moves the selected control or controls so that they are centered in the form vertically.  The rectangle that encloses all selected controls, including their titles, is centered.


Defining Data Views

Designing Form Controls

Form Design Control Pad

Arranging Controls on a Form

Aligning Controls on a Form

Designing a Scroll Region on a Form

Designing A Form Search Window

Designing Lookup Windows


Form Design Control Pad

See Also:  Form Control Pad

The form's design control pad is displayed at the top of the form in design mode.  When you click the left mouse button on a control pad icon, it sends a command to the form.

Click on an icon in the above graphic to view its function, alternate keystroke command, and alternate menu command.


Designing Forms
Designing Forms - Overview

See Also	Procedures

Steps in designing a form

1.	Determine what information you want to appear on the form and how the form will be used.  Determine the data view for the form.  The form will usually be closest associated with a particular table, most of the fields on the form will be from this table.  This table should be the primary table of the view.  Fields from other tables can be included to provide additional information on the form, but only fields from the primary table can be changed on the form.

2.	Decide on a preliminary layout of the controls on the form.

3.	Select the New command on the File menu, then select Form from the list of objects.  This will display a new, empty form on the desktop in design mode.

The following steps are performed by selecting commands from the Form Design menu, which you display by clicking the right mouse button when the mouse cursor is over the form ( if the form is not the active window, click it with the left button first), or by pressing Alt-M when the form has the focus.

1.	Define the basic attributes of the form by selecting the Form Attributes command on the Design Menu to display the Form Attributes Dialog.

2.	Define the data view for the form by selecting the Data View command on the Design menu to display the Edit View dialog.    The data view includes the database fields associated with the form, the record sort order, and the record filter rules.  Note: a form that has a sort order that is not an index of the primary table can't be used to add or delete records.  (See Defining Data Views.)

3.	Place a control for each field in the data view that you want to appear on the form.  You can use the Quick Layout command (see Quick Form Layout dialog) to quickly create a standard layout of selected controls, or you can create each control individually with the New Edit, New Combo Box, and New Text Box commands.

4.	Set the tab order of the controls.

5.	Select the colors for the form with the Colors command (see Colors Dialog).

6.	Select the fonts for the form with the Fonts command (see Fonts Dialog).

7.	If the form has a search window, design the search window (see Designing a Form Search Window).

8.	Some fields on the form may have lookup windows associated with them.  See Designing Lookup Windows for help on customizing these pop-up windows.

9.	If the form has an attached data exchange template, design the template (see Designing Data Exchange Templates).

10.	Set the size of the form by dragging its borders with the left mouse button.  The size of the form is saved with the design.  The size of a form can be changed only when the form is in design mode.

11.	Move the form to the position on the desktop where you want it to appear when it is first opened.  Move the form by dragging its title bar with the left mouse button.

12.	Leave design mode by selecting the Leave Design Mode command on the Form Design menu.

13.	Select the Run Diagnostics command, either on the Form menu (when not in design mode) or the Form Design menu (when in design mode), to check the design of the form.  (See Diagnostics);

14.	Save the form design by selecting the Save command on the File menu.

Once a form design has been saved, you can display it on the desktop by selecting the Open command on the File menu.

To make modifications to a form design

1.	Display the form on the desktop

2.	Select the Design Mode command from the Form menu

3.	Make the desired changes

4.	Leave design mode by selecting the Leave Design Mode command on the Form Design menu

5.	Save the form design with the Save command on the File menu

To delete a form design from the database

Select the Delete command on the File menu

Select the form design you want to delete from the list of forms and other desktop objects

Click OK or press ENTER.  Ad Hoc will ask you to confirm the deletion.

Design Considerations

To use the form for	Make sure that

Editing records	The Edit Records option is checked on the Form Attributes dialog.

Adding new records	The Add New Records option is checked on the Form Attributes dialog, and that the form contains a control for each required field in the primary table.

Deleting Records	The Delete Records option is checked on the Form Attributes dialog.

Importing/Exporting Data	You have designed a data exchange template appropriate for the import and/or export operation.


Form Design Window

Defining Data Views

Designing Form Controls

Arranging Controls on a Form

Aligning Controls on a Form

Designing a Scroll Region on a Form

Designing A Form Search Window

Designing Lookup Windows


Defining Data Views

See Also

Data Views are associated with forms, lists, and reports, and define the data from the database that will appear on the form, list, or report.  A data view is a collection of fields from one or more tables of the database.  In this respect, a view is like a table, except that its records are not stored physically in a file that corresponds to the view.  Instead, the records in a view are built  dynamically, as they are read from the view, from data fields stored in the database tables.  Using views, a form or report can work with data that is gathered from several different tables in the database.

In addition to the fields, a view definition consists of a sort specification, which defines the sort order of the records in the view, and a filter definition, which determines which records from other tables are selected to provide data for the view.

See Data View Dialog for specifics of using this dialog to define a view.

Primary Table

The primary table of a view is the main database table supporting the view.

Only fields from the primary table can be changed on forms, fields in the view supplied by other tables can only be displayed.

The pre-defined indexes of the view are the indexes of the primary table.

The view can include fields from tables other than the primary table if the tables are related to the primary table through one or more table links defined in the primary table definition.

The use of the form or report using the data view will usually make the choice of the primary table obvious.  If you are designing a form to enter employee data into the database, for example, the Employee Table will be the primary table.  In general, if you are defining a view based on two tables that are related by a link defined in one table, the table with the link definition should be the primary table.

Fields

The fields of a view can be any field from the primary table, or from any table that can be reached from the primary table by a link.  You can select fields from tables that are not linked directly to the primary table, but are linked to a table that itself is linked to the primary table.  A field is specified in a view definition by its extended field ID.

Fields to include depend on the object the view is attached to:

Object	Fields to Include

Form	All the fields that you want to display in controls on the form.  If the form is to be used to add new records, you must include all required fields of the primary table.  If additional fields will be used to define the sort specification or filter, these must also be included in the view definition.

List	All the fields that will be displayed in the list columns, and (if the list has been designed with a pop-up edit form) all the fields that will appear on the edit form.  If additional fields will be used to define the sort specification or filter, these must also be included in the view definition.

Report	All the fields that will appear in the report layout, fields that will be used in the definitions of computed report fields, and fields that will be used in the definitions of the view sort specification and filter.

Sort Specification

The sort specification consists of a list of fields that define the sort order of records.  Records are sorted by the values of the fields in the sort order.  Each field can be sorted in either ascending or descending order.  Any field in the view can be used in the sort specification.

If you specify a sort order that is also an index of the primary table, the primary table index is used to retrieve records.  Otherwise, each time the view is opened, its records must be sorted using a temporary sort file.  If you have a sort order that is used frequently for a report, form or list, define an index for it in the definition of the view's primary table so you won't have to wait for the records to be sorted each time you open the view.

Sorts for Forms

Forms that have a sort defined in the view that is not an index of the primary table of the view can't be used to add or delete records.  They can be used to display information or to edit records.  If you specify a sort that matches a primary table index, that index will be used to sort the form, and you can then add or delete records.  However, it's best not to specify a sort for a form at all.  Instead, add a search window to the form and give it an index control.  This allows you to change the sort order of the form to any of the primary table indexes while you are using the form.

Sorts for Lists

If a list will be used to edit records (has the AddEditDelete style) the same restrictions apply to its sort order as discussed above for forms.  If you specify a non-index sort for a list, the records displayed in the list will have to be sorted each time you open the list.  If a list has a non-index sort, you can still use an index control on the list and choose between the non-index sort specified in the view definition, or any of the indexes of the primary table.

Sorts for Reports

You must specify the sort order you want in the view definition of a report, even if it matches an index of the primary table.  If you don't define a sort order, the primary key index will be used.  If you specify a sort order that is an index of the primary table, the index is used when the report is printed, otherwise the records will be sorted before the report prints.

Filter

The filter of the data view determines how records are selected from other tables to make up the records of the view.  A filter selects records based on whether or not the values of specified fields in a record pass the comparison rules defined in the filter.  If no filter is defined for the view, each record in the primary table will generate a record in the view.

If you define a filter for a form (or a list that has the AddEditDelete style), you can only edit or delete records that pass the filter rules.  You can add a new record that doesn't pass the filter rules, but once you add it, you can't access it on the form unless you change the filter rules to include it.


Data View

Introduction to Databases

Edit View dialog.

Sort Specification Dialog

Filter Rules Dialog

Edit Filter Rule dialog

Extended Field ID


Extended Field ID

The extended field ID is used to identify the fields in a data view.  Within its table, a field is identified by the ID you specified on the Define Field dialog.  Since fields from different tables can have the same ID, the ID alone is not enough to specify a field in a view.  The table ID and field ID are still not enough, since the same field can be included in a view more than once through different table links.  To identify a field and its context within the view, the extended field ID contains the IDs of the links used to link the field's table to the primary table along with the ID of the field.   The link IDs and Field ID are separated by a period:

LINKID1.LINKID2.FIELDID

Example:

For an example based on the sample Ad Hoc database, take the data view specified for an employee report.  The view including fields from the Employee table (EMPID, LNAME, FNAME and DEPT) and  fields from the Department table (DEPTID, NAME, LOC).  The primary key of the Employee table is EMPID and the primary key of the Department table is DEPTID.  The Employee table is linked to the department table by a link with the ID DEPTLNK.

The primary table of the view is the Employee table.  The following extended field IDs describe the fields in the view.  Fields from the primary table have no link prefix.

Field ID	From Table	Extended Field ID	Description of the field
EMPID	EMPLOYEE	EMPID	The id of the EMPID field in the primary table of the view
DEPT	EMPLOYEE	DEPT	The department in which the employee works
NAME	DEPT	DEPTLNK.NAME	The name of the department in which the employee works
LOC	DEPT	DEPTLNK.LOC	The location of the employee's department


Designing Form Controls

See Also

The process of laying out a form consists of placing a form control on the form for each field in the data view that you want to display and optionally edit on the form.  Some controls, such as frames and buttons, arent attached to fields, but enhance the readability or function of the form.  To define or modify controls on a form, the form must be in design mode.

Control Type	Can be used with fields of type

Edit Box	Character, Integer, Numeric, Date

Combo Box	Character, Integer, Numeric, Date which have a validation type of Lookup

Text Box	Text

Check box	Character fields with length 1 and validation type of Set

Frame	not attached to a field, used for borders, lines, and text on the form

Button	not attached to a field, used to send commands to the form

Quick Form Layout

To quickly lay out a number of edit boxes on a new form, use the Quick Layout command on the Form Design menu.  (See Quick Form Layout dialog).

Placing a Control on a Form

Select one of these commands from the Form Design menu:

Selecting	Will display

New Edit Box	Edit Box Attributes dialog

New Combo Box	Combo Box Attributes dialog

New Text Box	Text Box Attributes dialog

New Check Box	Check Box Attributes dialog

New Frame	Frame Attributes dialog

New Button	Button Attributes dialog

1.	Use the dialog to define the field attached to the control, and other attributes of the control, then select OK.

2.	The dialog closes and the cursor changes to a cross

3.	Move the cursor to the position on the form where the upper left corner of the control (not including its title) is to be placed

4.	Click the left mouse button to place the control

Once a control is placed on a form, you can use the layout commands to move them to the correct position and size them.

Changing the Tab Order of Controls

The tab order is the order that you move from control to control when you press the Tab key.  (Pressing Shift-Tab moves you in reverse tab order).  The tab order should be the order you want to fill out the controls when you enter data on a form.  Frame controls are not included when you set the tab order.

1.	Make sure no controls are selected by clicking on a blank area of the form.

2.	Select the Tab Order Command on the Form Design Menu.  The cursor will change shape to indicate you are in Tab Order mode.

3.	Click the left mouse button on each control, in the order you want to establish as the tab order.  As each control is clicked, it is displayed with the selection border.

4.	Click on all controls, even if they will be display-only.  When all controls have been selected, Tab Order mode will be turned off.  To leave Tab Order mode before selecting all the controls, use the Tab Order Command.

5.	Press the Tab key to tab through the controls to check the order.  When the form is in run mode, you cannot tab to controls that are display-only controls.

Changing the Attributes of a Control

To change the title, style, and other attributes of a control

Click the right mouse button on a control to display the Form Control Design Menu

 Select the Edit Control Attributes command

To make changes to a number of controls, select all of them, then click the right mouse button on one of the selected controls a dialog will be displayed for each control in turn.


Quick Form Layout

Placing a Control on a Form

Changing the Tab Order of Controls

Changing the Definition of a Control

Arranging (Moving and Sizing) Controls on a Form

Aligning Controls on a Form


Arranging Controls on a Form

To design a form, you must arrange and size the data entry controls and scroll regions.  You do this by selecting one or more controls and then using a layout tool to move or size the selected controls.

Selecting Controls

Select a control by clicking the left mouse button when the cursor is on the control.  When a control is selected, a selection border is displayed that encloses the data area of the control, its border (or underline) and its title.  This is referred to as the selection area of the control.  Clicking anywhere within this area will select the control.

To select more than one control, use one of these options:

Hold down the Shift key and click the left mouse button on each control to be selected.  With the shift key down, clicking on a control that is already selected will un-select it.

Move the mouse cursor to a blank area of the form that is not in a control's selection area.  Hold down the left mouse button and drag the mouse cursor over the form.  A selection rectangle will be drawn on the screen as you drag the mouse.  When you release the left mouse button, any control whose selection area falls within the selection rectangle will be selected.

To select a second group of controls, follow the above procedure, but hold the Shift key down before you click the left button, and while you drag the mouse cursor.

When a group of controls is selected, clicking on a selected control will not change the selection, but clicking on an un-selected control (when the Shift key is not down) will remove the selection from the group and select the new control.

To un-select all controls, click on a blank area of the form that is not in a control's selection area.

Moving Controls

To move a control, first select it.  Move the mouse cursor to fall within the control's selection area, click and hold the left mouse button, then drag the control by moving the mouse.  When the control is in the desired position, release the left mouse button.

To move a group of selected controls, click and hold the left mouse button on any of the controls, then drag them to the desired new position.  The controls will move as a group, retaining their relative positions.

You can also move controls with the arrow keys on the keyboard.  With one or more controls selected, press the arrow key for the desired direction.  Hold the key down for continuous movement.  Each keystroke moves the controls one screen unit (pixel).  For faster movement, hold the Ctrl key down.  while pressing the arrow keys.  This causes the controls to move 5 pixels for each keystroke.  When the controls are in the desired position:

Accept the new position by pressing the Enter key, or clicking the left mouse button anywhere on the form.

Cancel the move by pressing the Esc key.

Sizing Controls

A new control is placed on the form with a default size, that is determined by the maximum length of data in the field attached to the control.  Once a control placed on the form, you can change its size by dragging the appropriate border of the control's selection area.

Select the control

Move the mouse cursor to the border you want to drag.  For example, if you want to make the control wider, either drag the left border to the left, or the right border to the right.

Move to a corner of the border to change width and height at the same time.

When the cursor changes to an arrow shape, click the left mouse button and hold it while dragging the border to the desired size, then release the button.

If several controls are selected, only the control you drag will be re-sized.

Restoring the default size

When you create a new control, it is given a default size based on its style, the current font, and the text size of the data field attached to it.  If you want to restore this size after you have  changed the size of the control, make sure this control is the only selected control, click the right mouse button it, and select either Default Height or Default Width from the Control Design Menu.

Restrictions on sizing:

When you change the size of a combo box control, you are changing the size of the drop down list for the control.  The area in which this list will be displayed is outlined in design mode so you can see where it will be.  The drop down list area is included in the control's selection boundary.


Aligning Controls on a Form

Aligning controls on a form consists of arranging or sizing a group of controls relative to each other.  In design mode, a set of alignment icons are displayed on the form's design mode control pad.  Clicking these icons carry out alignment and sizing operations on the selected controls.  There are corresponding commands on the Form Control Design Menu, displayed when more than one control is selected and you click the right mouse button on one of the selected controls.

Icon	Menu Command

Align Left

Align Right

Align Top

Align Bottom

Align Centers Horizontally

Align Centers Vertically

Space Equally Vertically

Space Equally Horizontally

Grow to Largest Width

Shrink to Smallest Width

Grow to Largest Height

Shrink to Smallest Height

Center in Form Horizontally

Center in Form Vertically


Designing a Scroll Region on a Form

See Also

A scroll region is a form control that contains an embedded list.  The list can be used to display records from another view that is related in some way to the view attached to the main form.  For example, a department form could contain a scroll region with a list of employees in the department.

Designing a scroll region is similar to designing a list.  Since the list is embedded in a form, there are some additional considerations:

The scroll region has form control attributes, including a title and the position of the title.  These are defined on the Scroll Region Attributes dialog.

The List Design menu of a scroll region is displayed by clicking the right mouse key on the scroll region. It has two commands not on the standard List Design menu:

The Control Style command displays the Scroll Region Attributes dialog

The Link to Parent command displays the Edit Link dialog, which enables you to describe how the scroll region view is linked to the parent form view.  The list within the scroll region is usually linked to the parent form.

To place a scroll region on a form

1.	Select the New Scroll Region command from the Form Design menu.  The cursor will be displayed as a cross.

2.	Move the mouse cursor to the spot you want the upper left corner of the scroll region to appear, then click the left mouse button.

3.	Fill out the scroll region attributes on the Scroll Region Attributes dialog and click the OK button or press ENTER.  The scroll region will be displayed.

4.	Click and drag the border of the scroll region with the left mouse button to size the region.

Moving a scroll region

Scroll regions are sized and moved like other form controls.

Note:  The tab bar area of list in the scroll region cannot be used to select or drag the scroll region.  Mouse actions in this area are for moving and defining the column tabs of the list.

To design the scroll region

Size and position the scroll region as described above.  Clicking the right mouse button on the scroll region displays the List Design menu.

1.	Define the scroll region data view with the  Data View command on the Design menu.

2.	Define the scroll region list attributes with the List Attributes command.

3.	Define the scroll region colors and fonts with the Colors and Fonts commands

4.	Define the title (on the form) and title position of the scroll region with the Control Style command

5.	Define the way the data view of the scroll region is related to the data view of the parent form with the Link to Parent command.

Note:  The link between the list in the scroll region and the parent form is not active while the form is in design mode.


Designing Lists

Arranging Controls on a Form

Aligning Controls on a Form


Designing a Form Search Window

See Also

To include a search window on a form, check the Search Window option on the Form Attributes dialog.  When the form is in design mode, use the Search command to display the search window in design mode.

Follow the same steps in designing a search window that you would to  design a list, with the following restrictions:

You do not need to specify an ID or name for a search window since it is part of the parent form.

The data view of the search window must have the same primary table as the data view of the parent form.

The button style of a search window must be OkCancel.

A search window cannot be used to add or edit records, only to find records for the parent form.

After you have specified the search window layout and control options:

1.	Select the sort option that you want to be the default option the first time the search window is displayed.

2.	Size and position the list where you want it to appear in relation to its parent form.  When you save a form design, the current size and position of the search window with respect to the parent form are saved with the design.

Size the search window by dragging its borders with the left mouse button down.

Position the search window by dragging its title bar with the left mouse button down.

To hide the search window during the design process, click the OK or Cancel button, or press the Esc key.


Designing Lists


Designing Lookup Windows

A lookup window is a specialized list that is automatically attached to the edit boxes on a form that have fields whose values can be looked up in other tables.  These fields are those for which a link has been defined in the data dictionary from the field to another table.  (See Table Links).  When you create a form, a lookup window is automatically created for each edit box with a linked field.  Each lookup window has a default size and set of attributes, and contains only the primary key field of the lookup (linked) table.  You can change the design of a lookup and add additional fields as columns in the lookup list.

To Design the lookup window attached to a control

With the form in design mode, select the control.  It must be the only selected control.

Click the right mouse button on the control

Select the Design Lookup Window command on the pop-up menu to display the controls lookup window

Since a lookup window is a specialized list, you design it like any other list, with certain restrictions.  See Designing Lists for information on general list design.

Data View

You cant edit the data view of a lookup list.  Its primary table is the lookup table linked to the field being edited, and its fields are all the fields of the lookup table that can be displayed a columns in a list.  All these fields are available for including as columns on the lookup list.  You cant specify a sort or filter for the lookup list view, but if you include an index control on the list, you can select an index of the lookup table to order the list entries.  The index selected for a lookup list when the form design is changed will be the initial index displayed for the lookup list whenever you open the form.

Displayed Fields

A default lookup list will always display the primary key field of the lookup table.  You can add additional fields to the list, and set column spacing,  in design mode.

Other Design Attributes

Other list attributes that you can change for lookup windows include the colors, fonts, column headings, index and search control options, and the initial size of the window when the form is opened.


Lists

The List Window

Using Lists

Displaying Lists

Entering Data with a List

List Sort Control

List Search Control

Changing the Record Selection Filter

Attaching a Report to a List

Designing Lists


The List Window

See Also	Procedures	Design Procedures

Click on an object in the above graphic to see a short description.


Using Lists

Displaying Lists

Entering Data with a List

List Sort Control

List Search Control

Attaching a Report to a List

Designing Lists


The list title bar displays the name of the list.  You can click and drag the title bar to move the list on the desktop.  You can double-click the title bar to maximize the list window.  When a list is in design mode, the word "Design" precedes the name of the list.  When a list is sorting or is linked to another form or list, that is also indicated in the title bar.


The sort control of a list is a combo box that enables you to select the order that records will be displayed in the list.


The search control of a list is an edit control that enables you to search for a particular record in the list.


The search fields area on a list shows the fields that define the sort order of the records.  These fields are used to search for a record when you enter a value into the search edit control.


The Tab Bar is only visible when a list is in design mode.  It displays the column tab settings:

Click and drag a tab with the left mouse button to change the width of a column

Click on a tab with the right mouse button to display the tab alignment menu


The column heading area of a list displays the titles of the fields displayed in the list.


The main area of a list displays the list entries.  Each list entry corresponds to a record from the data view of the list.


List Command Buttons

A list can contain command buttons at the bottom of the list.  When you click on these buttons, commands are sent to the list.   There are two styles:

Button Style	Description

OK / Cancel	Selects an entry in the list, hides a pop-up list (such as a form search window).

Add / Edit / Delete	Indicates the list has an associated pop-up edit form that can be used to add, edit, or delete records in the list.


Using Lists

See Also	Procedures

A list is a desktop object that displays records from the database in a row and column format.  A row in the list corresponds to a database record.  The columns in the list correspond to fields in the record.  When you design a list, you define its data view, which determines which fields from the database are displayed in the list.  Special uses of lists include form search windows and form scroll regions.

The design of a list can include a pop-up edit form, which enables you to edit or delete a record displayed in a list, as well as add new records.

A list can also have index and search controls that enable you to change the ordering of records in a list and easily find a particular record.  The keystroke navigation feature helps you locate a record in a list.


Keystroke Navigation on Lists

In addition to scrolling up and down a list with the arrow keys or the scroll bar, or locating a record in the list with the list's search control, you can use the keystroke navigation feature of Ad Hoc to quickly locate a record in a list.  Keystroke navigation refers to using character keystrokes to move through a list whenever the list has the input focus.  Select a keystroke navigation option on the Desktop Configuration dialog.

With both types of keystroke navigation, the character keys you type are matched against the sort fields of the records displayed in the list.  See help on the list search control for details on how the matching is done.

Progressive Keystroke Navigation

Progressive keystroke navigation works much like a list search control.  When you type a character key, the character (letter or digit) is added to a search key.  If the list has a search control, the search key is displayed in the search control, otherwise you can't see it.  The highlighted entry in the list becomes the one that most closely matches the search key as you type.  If you press the backspace key, the last character in the search string is removed and the highlight moves back to the previous matching record.

To cancel a search string (for example to start another search), press the SPACE BAR.  The highlight will not move from the current record, but the next letter you type will start a new search.

Single-key Navigation

With this type of keystroke navigation, only the first character of each record is used to match keystrokes you enter.  This is the method used in a standard Windows 3.1 list box.  When you type a letter key, for example, the first entry in the list that starts with that letter is highlighted.  When you type that key again, the next entry in the list starting with that letter is highlighted.  When you reach the last matching entry, typing the letter key again takes you back to the first match.


The List Window

Keystroke Navigation

Displaying Lists

List Sort Control

List Search Control

Entering Data with a List


Displaying Lists

To open a list and display it on the desktop:

1.	Select the Open command on the File menu to display the Open dialog.

2.	Highlight the name of the list you want to open, by clicking it or using the up or down arrow to highlight it.

3.	Click the OK button, or press ENTER.

You can also just double-click on the name of the list to open it.

To put away a list

Make sure the list is the active desktop object.  Then do one of the following:

Select the Close command on the File menu.

Double-click the system menu icon in the top left corner of the list.

Click the system menu icon to display the menu, then select the Close command.

To close all the open lists and forms on the desktop, select the Close All command on the Window menu.


List Control Pad

If you select the control pad option on the List Attributes Dialog, the list will have a control pad is displayed at the top of the form.  The control pad contains icons representing control functions for the form.  When you click the left mouse button on an icon, it sends a command to the form.  Some of these icons may not appear, depending on the status of the form.

Click on an icon in the above graphic to view its function, alternate keystroke command, and alternate menu command.


Add Record

Click this icon on a list control pad to display a pop-up edit form to add a new record.  This icon appears only if the list includes and edit form and the list has the add records permission set.

Keystroke Equivalent:	Alt-A

Form menu command:	Add Record


Delete Record

Click this icon on a list control pad to delete the selected record.  This icon appears only when the list includes an edit form and the list delete records permission is set.

Keystroke Equivalent:	Alt-D

Form menu command:	Delete Record


List Sort Control

The sort control on the control pad of a list is a combo box that displays the sort options of records in the list.  Click on the sort control  to display the drop-down list of the combo box, then click on an entry to select it.  The entries in the sort order list will include:

All the indexes defined for the root table of the data view.  Each of these entries will include the index number and description.

The sort defined for the list data view, if one was defined.  This entry will show the fields in the sort specification of  the list's data view.

When you select a sort, the names of the fields that define the sort will be displayed to the right of  the search control.

If the list is a search window of a form, selecting an index as the sort order will also set the order of records in the parent form to the same index.


List Search Control

The search control on a list is an edit control that enables you enter a search value to find a particular record in the list.  When you select a sort order for the list, the fields that define the sort order are displayed to the right of the search control.  The value you enter in the search control is used to find a record with the closest match in these fields.

To find a record

1.	Determine which sort order you want to use to locate the record and select it with the sort control.

2.	Move to the search control by clicking on it, pressing Alt-S, or tabbing to it.

3.	Enter a search value that will be used to find the closest matching record.  The value you enter will be compared with value in the first sort field.

4.	Press the ENTER key (or click the OK button if the list has one).

5.	The first record from the data view that most closely matches your entry will be highlighted in the list.

How records are matched

If there is only one field that defines the sort order of a list, the search value you enter is compared with the contents of that field in each record.  The selected record is the first one in the data view whose field value is equal to or greater than the search value.  If the sort order is defined by more than one field, the first field is used.

You can enter a search value for more than one field in the sort order by separating the values with a comma.  The first value you enter is compared with the first field, the second with the second, etc.  The record selected will be the first record in the data view whose field values, taken together, are equal to or greater than the search values.

Example

A list of employee records, the sort order is Last Name, First Name.  In the employee table are the following employees:

Roberts, Peter
Smiley, Beth
Smith,  Michael
Smith,  Theresa
Sommers, John

Entering Search Value	Will find the record for

S	Beth Smiley

Smith	Michael Smith

Smith,T	Theresa Smith

Smi,Theresa	Beth Smiley (because Smiley is the first record greater than or equal to Smi)


Entering Data with a List

A list can be used to enter and edit records in the database if it has been designed with a pop-up edit form.  A list with an edit form has Add, Edit, and Delete command buttons displayed at the bottom of the list.  The list edit form is displayed if you click the Add or Edit buttons.

Entering data on a pop-up edit form is similar to using a standard form for entering data (see Entering Data on a Form).  The differences are:

The pop-up edit form of a list can display only the record that is highlighted in the list (or a new record that will be inserted in the list).

The pop-up form's control pad contains only the update and cancel icons.

To edit (make changes to) a record

1.	Highlight the record in the list.

2.	Click the Edit button, or press Alt-E.

3.	Make the changes on the pop-up edit form, then select the Update Record command.

To cancel the edit, use the Cancel Record Changes command.

To add a new record

1.	Click the Add button, or press Alt-A.

2.	Fill out the pop-up edit form, then select the Update Record command.

To cancel the add, use the Cancel Record Changes command.

When you add a new record, the new record is displayed and highlighted in the list.

Note:  You can add new records on a list only if the Add permission was specified in the list design and the edit form contains all the required fields in the root table of the list's data view.

To delete a record

1.	Make sure the correct record is highlighted in the list.

2.	Click the Delete button, or press Alt-D.

3.	Ad Hoc will ask you to confirm the deletion.

You can delete records in a list only if the Delete permission was specified in the list design.


Designing Lists

See Also	Procedures

Lists have a number of uses in Ad Hoc.  The basic steps in designing a list are the same for all uses, but there are some differences.  This help topic describes the design process for a standalone list, see the topics noted below for specifics on the other uses of a list.

Use	Design Process

Standalone desktop object	Use the New command on the File menu to open a new list and the Save command to save it in the Forms table.

Search window of a form	Designed as part of the form.  See Designing a Form Search Window.

Lookup window for a field	Designed as part of a form.  See Designing Lookup Windows.

Embedded in a Scroll Region	Designed as part of the form.  See Designing a Scroll Region on a Form.

Steps in designing a list

Use the File New command on the File menu to open a new list on the desktop, or use the File Open command to open an existing list.  A new list is opened in design mode.  To put an existing list in design mode, select the Design Mode command on the List menu.  Display the List menu by clicking the right mouse button on the list, or by pressing Alt-M.  To design a new list:

1.	Decide how you want to use the list, and what data will appear on it.

2.	Define the data view attached to the list by selecting the Data View command on the List Design menu to display the Data View dialog.  See Defining Data views.

3.	Define the list controls, and database permissions by selecting the List Attributes Command to display the List Attributes dialog.  See Designing a List Layout.

4.	Define the fields to appear in the columns of the list by selecting the Columns command on the List Design menu to display the List Column Fields dialog.

5.	Position the columns of the list (See Setting List Columns).

6.	Select the list colors by using the Colors Command to display the Colors dialog and the list fonts by using the Fonts Command to display the Fonts dialog.

7.	If you have specified the AddEditDelete button style on the List Attributes Dialog, the list will have a pop-up edit form.  Design the Edit Form (see Designing a List Edit Form).

8.	Size the list by dragging its borders with the left mouse button.  The size of the list when it is saved will be its initial size when it is opened on the desktop.

9.	Move the list to the position where you want it to appear on the desktop when it is first opened.  Move the list by dragging its title bar with the left mouse button.

10.	Leave design mode by selecting the Leave Design Mode command on the List Design menu.

11.	Select the Run Diagnostics command on either the List Run menu or the List Design menu, to check the design of the list.  (See Diagnostics).

12.	Save the list design with the Save command on the File menu.

To make modifications to a list design

1.	Display the list on the desktop

2.	Select the Design Mode command from the List menu

3.	Make the desired changes

4.	Leave design mode by selecting the Leave Design Mode command on the List Design menu

5.	Save the list design with the Save command on the File menu

To delete a list design from the database

Select the Delete command on the File menu

Select the list design you want to delete from the list of forms and other desktop objects

Click OK or press ENTER.  Ad Hoc will ask you to confirm the deletion.


Defining Data Views

Designing a List Layout

Setting List Columns

Designing a List Edit Form


Designing a List Layout

The elements of a list layout include

The controls that appear on the list

The fields that are displayed in the columns of the list

The spacing and alignment of the columns

The fonts and colors of the list

List Controls

The controls that appear on a list are defined on the List Attributes dialog.

Check the  Search Control option if you want to be able to find records in the list by typing in a search value.

Check the Sort Control option if you want to be able to change the record sort order while using a list.

Select one of the following button styles

Button Style	Description

None	The list will have no command buttons.

OKCancel	Used for search windows.  The list will have two buttons:
OK hides the list and sends a selection notification to its parent form
Cancel hides the list.

AddEditDelete	Indicates the list has an associated pop-up edit form that can be used to add, edit, or delete records in the list.  The list will have three buttons:
Add displays the edit form for adding a new record
Edit displays the edit form for editing the current selection in the list
Delete deletes the current selection in the list

List Fields

Select the fields to display in the columns of the list from the fields defined in the data view.  Fields to be displayed are selected on the List Column Fields dialog.

If you select the Display Column Headings option on the List Column Fields dialog, you can designate a title for each column.  The fields you display will depend upon your application, but you should include fields that will help the user identify the records in the list.  (For example, for a list of employees, you should include the employee ID and name).  Include fields that help the user identify the sort order for each sort option available in the list.  (For example, if you can order the employee records by employee ID, the ID field should be included as a column in the list.)

Spacing and Alignment of List Columns

Once you have designated the fields that will be displayed on the list, you can size the columns using the tab bar displayed at the top of the list in design mode (see Setting List Columns).

Fonts and Colors

Use the Font command on the List Design menu to designate the fonts in the list.

Use the Colors command on the List Design menu to designate the list colors.


Setting List Columns

A list displays records in a row and column format.  Each row is a record, and each column corresponds to a field in the record.  When a list is in design mode, a tab bar is displayed above the column heading area of the list.  The tab bar contains a tab for each column in the list.

Tabs can only be moved right or left;  they cannot be deleted.

To move a column

1.	Click and hold the left mouse button when the cursor is over the tab for the column.

2.	Drag the tab to the left or right, release the mouse button at the desired location.

To move a column and all columns to the right

Depress and hold the Shift key, then click and drag the tab to the desired position.  All tabs to the right of the dragged tab will maintain their relative positions to this tab.

To change the width of a column

Move the tabs located to the right of the column.

To add a column

Insert a new field in the Column Fields list on the List Column Fields dialog.  Insert the field in the correct position in the Column Fields list.  The list determines the order of the columns from left to right.

To remove a column

Delete the corresponding field from the Column Fields list on the List Column Fields Dialog.

To change the alignment of a column

Click the right mouse button on the tab for the column to display the column alignment menu.  Select the desired menu option.

Alignment Type	Description

Left	The column is left aligned at the tab position

Right	The column is right aligned at the tab position

Centered	The column is centered around the tab position

Decimal	The contents of the column are positioned so that the first decimal point (period) is aligned with the tab position.  If there is no decimal point, this option acts like right alignment.  Use this alignment only for numeric fields that contain a decimal point.


Designing a List Edit Form

If you want to edit database records displayed in a list, you must include a pop-up edit form in the design.  With the form in design mode:

1.	Select the AddEditDelete button style on the List Attributes dialog.

2.	Set the database access permissions allowed for the list (see List Attributes dialog).

3.	Click on the Add or Edit list command button (or press Alt-A or Alt-E) to display the edit form.

4.	Size the edit form by dragging its borders with the left mouse button

5.	Position the edit form by dragging its title bar with the left mouse button.  Position the form where you want it to pop-up relative to its parent.

6.	Design the layout of the form just as you would design a standard desktop form (see Designing Forms).  Clicking the right mouse button on the list edit form displays the Form Design menu.

7.	An ID is not needed for a pop-up form, and a name is optional.  If you supply a name, it is displayed in the title bar of the form, preceded by "Edit" in Edit mode and "New" in Add mode.

8.	Make sure the form is the correct size.

9.	Hide the pop-up edit form with the Cancel command or the Hide Pop-up Form command on the Form Design menu (this command replaces the Leave Design Mode command for pop-up edit forms).

Design Restrictions:

The edit form uses the data view of the parent list, so all fields that will appear on the edit form must be defined in the list data view.

Database add, edit, and delete permissions for the list apply to the edit form.  They are defined on the List Attributes dialog.

A list edit form cannot have a data exchange template.

You cannot leave design mode from the edit form.  You must hide it and use the Leave Design mode command on the List Design menu.

Edit Forms for Embedded Lists

If a list embedded in a scroll region of a form is linked to the parent form (the usual situation), you do not have to put the fields that define the link on the pop-up edit form.  They are automatically set to the values determined by the current record on the parent form.  Using an example from the Ad Hoc sample database, on the Employees form there is an embedded list called Personnel Actions.  This list is linked to the Employees form by the employee ID.  The pop-up edit form for this list doesn't have a control for Employee ID because the ID is automatically set to the ID of the record currently displayed on the Employee form when a new personnel action is added to the list.


Keyboard Reference

Global Keys for Ad Hoc

F1	Display context sensitive Help

Shift+F1	Display help system table of contents

Ctrl+F1	Search for help on a topic

F2	Open a desktop object

Shift+F2	Open a new desktop object to design

F3	Close the active desktop object

F4	Save the design of the active desktop object

F9	Print a report

Shift+F9	Open a report design window

Ctrl+F9	Display a report on the screen

F10	Display/Hide Tables Window

Forms

Ctrl+D	Delete the current record

Ctrl+F	Display the first record in the data view

Ctrl+L	Display the last record in the data view

Alt+M	Display the Form Menu (or the Form Design Menu if in design mode)

Ctrl+N	Display the next record

Ctrl+P	Display the previous record

Ctrl+S	Display the search window to find a record

Enter	Accept changes on the form, update the database

Esc	Discard changes on the form, restore the original contents

Ins	Start editing a new record

Tab	Move from one control to another on the form

Shift+Tab	Move backwards from one control to another

F6	Cycle between the form and its scroll regions (if any)

F8	Print the current record (if a report is attached)

Ctrl + F8	Start a new page on the attached report

Lists

Alt+A	Display the edit form to add a new record

Alt+D	Delete the selected record in the list

Alt+E	Display the edit form to edit the selected record in the list

Alt+M	Display the List Menu (or the List Design Menu if in design mode)

Alt+O	Move to the sort order selection control

Alt+S	Move to the search control

Enter	Accept the selected record and close (for search windows)
Accept the search value and find a record (for search windows when the search control has the focus)

Esc	Close with no selection (for search windows)

F8	Print the current record (if a report is attached)

Ctrl + F8	Start a new page on the attached report

Report Design Windows

Ins	Insert a field at the cursor position

Shift+Ins	Insert a new element below (after) the current element

Alt+M	Display the Report Design Window pop-up menu

Report Display Windows

Ctrl+F	Display the first page

Ctrl+G	Go to Page...

Ctrl+L	Display the last page

Ctrl+N	Display the next page

Ctrl+P	Display the previous page


Reports

Understanding Reports

Special Report Types

Report Styles

Printing Reports

Report Startup Dialog

Displaying Reports on the Screen

Sending a Report to a Text File

Printer Setup

Report Design Window

Report Display Window

Designing Reports


Understanding Reports

Ad Hoc uses a unique model for a report that gives you a great deal of flexibility in designing complex reports.

Report Identifiers

When you design a report, you must specify a report ID, which is unique to that report, and a name for the report.  The ID is used to store the report design in the database, the name is displayed in report selection lists.

Report Data View

You specify the information from the database that appears on the report by defining a data view for the report.  As with any data view, you can specify the sort specification and filter.    The fields from the view can be inserted anywhere in the report design.  When Ad Hoc prints a report, it opens the report view and reads records from the view.  As each record is read, it triggers an event. Events result in an action such as the printing of a line of the report, or a computation of a report field value.  See Report Events for a list of the events.

Report Layout

A report design specifies how information is presented on a printed page.  The Report Layout dialog enables you to specify the physical dimensions of the page, and the page margins.  You can also specify whether the report is printed in landscape or portrait orientation.  The page size, orientation, and margins determine the area in which the report can be printed.  There are custom layout dialogs for special reports that print labels and envelopes (See Special Report Types).

You must define one or more regions within the report area.  A region specifies an area within which specified information is printed.  A simple report layout may have two regions: a page header region within which the title and column headings are printed, and a detail region, within which the detail lines of the report are printed.

A report element defines the information that is printed in a report.  An element can contain text, database fields, and report fields.  When you design a report, you specify the contents of each element, its tab settings, and its font.  An element is printed in response to an event and is printed in a specified region.  In the simple report mentioned above, there would be two elements, one for the title and column headings, and one for the report detail line (one detail line is printed for each record read from the view).  When a page header event occurs, the title/column heading element is printed in the page header region.  When a next record event occurs, a detail line is printed in the detail region.  As each record is read, a detail line is printed until the detail region is full.  This triggers a page header event, and a new page is started. You can attach a filter to an element to control under which conditions a element is printed.

Regions can be sized by the size of their contents, so that only one instance of each element in the region can fit.  A page header region would fall into this category.  Regions can also be larger than the elements assigned to the region, in which case the elements are repeated in the region until it is full.

Fonts and Tab Settings

You can specify a font for each report element.  You can also specify a default font for the report that can be assigned to several elements.  Changing the default report font automatically changes the fonts for all elements using the default.

You can specify tab settings for each element.  You can also specify a common set of tabs that can be used by several elements

If you need to use different fonts or tab settings within a section of the report, you must break that section up into different elements for each font or tab setting.

Computed Fields

In addition to the database fields defined in the view, you can define additional fields for the report.  The definition of these fields includes an expression that is used to compute the field value, and an event that triggers the computation of the value.  Computed fields can be placed on the report startup dialog, so that the user can enter a value before the report prints.  Computed fields can be included in a report layout, or can be used in the filter of the data view, allowing the user to specify record selection criteria for the report.  See Field Expressions for more information on expressions.

Counter Fields

Counter fields are a special kind of computed field that are computed from the values of database fields as records are read.  They can hold a count of records, a running total of a specified numeric field in the data view, a running average of a specified field, and other types of computations.  See Counter Field Dialog for a detailed description.


Special Report Types

Ad Hoc provides a number of special report types that automate the report design and printing procedures.  To support special reports, Ad Hoc has a special table for storing report styles.  The report styles support are for label and envelope report layouts.  The Styles table contains a number of pre-defined standard styles for labels.  You can design your own custom styles and save them in the Styles table.

Label Reports

Label reports are used for printing all types of labels: mailing labels, shipping labels, name tags, rolodex labels, etc.

Envelope Reports

Envelope reports are used for printing envelopes.

Report (Quick Setup)

This is another option you can select when you create a new report.  Select this option when you want to design a report that prints a line for each record, and prints the fields in columns.  See Creating a Report Quickly.


Label Reports

Label reports are used for printing all types of labels: mailing labels, shipping labels, name tags, rolodex labels, etc.  It can be used for any report that has a repeating rows and columns of a single element.

Creating a new label report is easy: just select a label style from the Styles table, specify which data fields will be printed on the label and where they will be located, select a font, and save the report design.

The Label Style dialog makes it easy to design and save custom label layouts.

When you print labels, if you selected the Startup Dialog option on the Label Report Layout dialog, you can use the report startup dialog to select a different label style, and change the font, label margins, and printer options for the current report.

Before a label report starts, Ad Hoc also displays the Label Window to allow you to specify which label on the first sheet to start with.  This is useful if some of the labels on the first sheet have already been used.  You can also change whether the labels are printed by rows or by columns.

See Designing Label Reports


Envelope Reports

Envelope reports are used for printing envelopes.  Creating an envelope report is also easy: just select an envelope style from the Styles table, or select a standard envelope size with default positions for delivery and return addresses, specify which fields will be used for the addresses, select fonts, and save the design.

The Envelope Style dialog makes it easy to design and save custom envelope layouts.

When you print envelopes, if you selected the Startup Dialog option on the Envelope Report Layout, you use the report startup dialog to select a different envelope size or  style, change the fonts, and select other options for the current report.

See Designing Envelope Reports


Report Styles

A report style is a design for a specialized report that can be defined and saved separately from the report.  Report styles can be specified when you design a report, and when you print a report, you can select a different style for that printing.

Ad Hoc provides a special system file, _STYLES.DBF, which corresponds to a table with the ID _STYLES, in which report styles are stored.  The data dictionary of every Ad Hoc database contains a table definition for the _STYLES table, so that the stored styles are available for reports defined in every database.  _STYLES.DBF is located in the same directory that the Ad Hoc program files were installed in.

When you make changes to a report style, those changes are automatically reflected in every report that uses that style.

Ad Hoc currently supports two types of report style:

Label Styles

A label style is used for label reports, and contains information on the size of labels and their arrangement on the page.  The Styles table contains a number of pre-defined standard styles listed by Avery product number.  There are two subcategories of label style:

Sheet Labels are used for laser printers and are usually laid out on an 8 ½ x 11 page.

Continuous or Pin-Feed labels are used for dot matrix printers with tractor feeds.

You can create custom label styles using the Label Style.  See Designing Label Reports.

Envelope Styles

An envelope style is used for envelope reports, and contains information on the envelope size, and the position of addresses and special messages on the envelope.

You can create custom envelope styles using the Envelope Style.  See Designing Envelope Reports.

To design a report style without designing a complete report

Select the New command on the File menu

Select the Label Report or Envelope report option, depending on the style you want to create

On the Layout Dialog, select Style to display the Style Dialog

Select the Custom style entry and design the style

To copy and modify an existing style, select that style first, then select the Custom entry.  This does not change the settings of the last style selected, but allows you to save changes under a new style name.

Make changes on the dialog to design the new style

Select Save to save the new style under a new name.

The above steps can be repeated for additional styles

Select Cancel on the Style dialog

Select Cancel on the Report Layout dialog to cancel the report design procedure


Report Events

Event	When it happens

Report Header	At the beginning of the report, after the computed fields are computed and the report startup dialog is displayed.

Page Header	Each time a new page is started, including the first page.

Next Record	Each time a record is read from the view.

Page Footer	The last event for a page, just before a new page is started.

Report Footer	At the end of the report, before the last page is completed (before the page footer of the last page)

Break Header	After a record is read, but before the next record event, if the record causes a report break.  A break header event is generated for each break level that has occurred.

Break Footer	After a record is read, and after the next record event, if the next record to be read will cause a report break.  A break footer event is generated for each break level that will occur.

Break header and footer events are issued in the order of the break levels. Higher level break headers are issued before lower levels, and lower level break footers are issued before higher levels.  When a break event is issued, all lower level break events are automatically issued.

Example

Assume an employee report sorted by department and group within department.  The report includes a heading for department that is printed each time the department changes, and a total line showing the number of employees in the department.  There is a similar header line and total line for group.  You would define break levels for department and group.

As the report is printed, if the next record to be read is an employee from a different department than the current record, the break events will occur in the following sequence (includes the next record event of the current record):

Event	Triggers this element

next record	report detail line for current record

group break footer	total line for group

dept break footer	total line for department

dept break header	heading for the next department

group break header	heading for the next group

next record	report detail line for next record


Printing Reports

Report designs are stored in the Reports table of the database.  To print a report:

1.	Make sure your printer is connected, turned on, and on-line.

2.	If the report requires a special printer configuration, such as page orientation or paper source, use the Printer Setup command on the File menu to select and configure a printer.

3.	Select the Print Report command on the File menu to display the Print Report dialog.

4.	The Print Report dialog contains a list of all reports stored in the database, sorted alphabetically by name.

5.	Highlight the report you want to print, then click the OK button or press the Enter key.

6.	Shortcut: Select a report and print it by double-clicking on the entry in the list.

7.	If the report has a startup dialog, enter the information requested on the dialog, then press Enter or click the OK button.

8.	If the report has to sort records in its data view, it will display a sorting progress box showing the number of records read and the total number to sort.

9.	While the report is printing, the Print Report dialog is displayed.  This dialog shows the report being printed, the printer being used, and the page of the report that is currently printing.

10.	To cancel the report before it completes printing, click the Cancel button on the Print Report dialog.


Report Startup Dialog

See Also

A report startup dialog, or report dialog, is an optional dialog that is displayed prior to printing (or displaying) a report.  Specify the Startup Dialog option on the Report Layout dialog when you design the report.

On the report dialog, you make changes to the printer settings or the report design that are applicable just to the current printing of the report.

Report Dialog Options

Paper Source

Select a paper source (tray) from a list of sources applicable to the current printer.

Orientation

Select portrait or landscape orientation.

Printer

Select Printer to change the printer settings or select a different printer.

Layout

For envelope or label reports, select Layout to select a different report style or make other changes to the report layout.

Note:  If you print or display a report from a report design window, this option is not available.  Make layout changes from the report design window.

Adjustments

If you need to specify special adjustments to the position of the printed image on the page, check the Apply Print Adjustments option and click the Adjustments button to display the Print Image Offsets dialog (See Print Image Offsets Dialog for description of these adjustments).  If the Apply Print Adjustments option is not checked, no print image offsets will be applied to the report.

OK

Select OK to print the report.

Cancel

Select Cancel to cancel the report printing.

Report Fields

In addition to the above standard options, you can layout the top area of the report dialog to include report fields that will either be displayed on the report, or will be used to control the printing of the report (such as specifying filter values).

See Designing a Report Startup Dialog for help on designing a report dialog.


Designing a Report Startup Dialog

Printer Setup

Label Layout Dialog (from Report Startup Dialog)

Envelope Layout Dialog (from Report Startup Dialog)


Label Preview Window

The Label Preview window displays a picture of a sheet of labels.  This window is used for two purposes:

Select First Label

When you print a label report using a sheet label style (e.g., a label for laser printers), the label window is displayed before the report starts.  The selected label style is displayed, and the labels are numbered in the order in which they will be printed.  If some of the labels on the first sheet have been used, you can designate the label the report should start on.

Click the left mouse button on the first label to be printed.  This applies only to the first sheet of labels used for this report.  The numbers on the labels that will be skipped are grayed out.

Select Dir to change the direction in which the labels are printed (by rows or by columns)  The numbers on the labels will reflect this direction.

Select OK to print the report.

Select Cancel to cancel the report.

If a label report also has a report startup dialog, the startup dialog is displayed first, and then the label window.

Previewing a Label Style

You can display the label preview window when you are selecting a label style or designing a label style.  From either the Label Report Layout dialog or the Label Style dialog, select Preview to display the label preview window.

Select OK on the label window to close it.


Printer Setup

Use the Printer Setup command on the File menu to display the Printer Options dialog.  Use this dialog for selecting and configuring a printer.  When you select a printer and configure it using the Printer Setup command, the settings are used only by Ad Hoc; the printer configuration you designate within Ad Hoc is not seen by other programs.

Click the Printer button on the report startup dialog to display the Printer Options dialog and make changes just prior to printing a report.  The setup changes you make here apply only to the current printing of the report.

The printer settings that are most commonly changed are:

Page Orientation

A report can be printed in landscape orientation or portrait orientation.  A report design can designate a specific  orientation to be used for the report, or can designate that the current printer setting be used.  In the latter case, you can set the orientation of a report with the Printer Setup command.

Paper Source

Most printers offer at least two paper sources: automatic feed and manual feed.  Some offer more than one paper bin, or have an envelope feeder.  You can specify the paper source as part of the report design.

Paper Size

When you specify a page size for a report (or an envelope size for envelope reports), Ad Hoc will determine if the printer supports that paper size, or if allows the software to specify a custom paper sizes.  If it supports neither, Ad Hoc will specify a default size to the printer and then adjust the print image on the page to account for the actual size of the paper.

Changing Printer Setup just before printing a report

If a report has a startup dialog, you change printer options or select a new printer from this dialog just before printing a report.


Displaying Reports on the Screen

See Also

To display a report on the screen, select the Display Report command on the File menu, or select the Display command on the Report menu when a report design window is active.

Reports are displayed with the same layout, fonts, tabs, etc. as when they are printed.  The report display window is useful to preview a report as you are designing it.


Report Display Window


Report Display Window

See Also

You use a report display window to view a report on the screen instead of printing it.  To open a report display window, select the Display Report command on the File menu.  A special form of report display window is integrated with a report design window, and can be displayed by selecting the report preview mode in the design window.

When you select a report to be displayed, the report display window will load the report from the database, and begin generating the report output.  As soon as the first page is completed, it is displayed in the window.  You may move to any page that has been generated while the report is being processed.  After the report processing is complete, you can view any page of the report until you start another report or until you close the report display window.

You can change the scaling (magnification) of the report to from 10 percent to 200 percent of actual size (as it would appear on the printed page). you may find that a scaling of around 75 to 80 percent is most readable.

Since a report for an 8 1/2 x 11 inch sheet of paper, for example, will not fit entirely within a window, and scaling it to fit would probably result in a font size that is too small to read, you have an additional option of shortening the page height in the report design to match the height of the report display window.  When you change this option, you must restart the report.  Page heights are fixed after a report is generated, although you can change the magnification at any time.

Report Display Window Menu

The report display window menu appears on the main menu bar when a report display window is active.  You can also display a fast menu by clicking the right mouse button whenever the cursor is over the display area of the window.  This menu contains commands that allow you to select reports, restart the current report, select pages for display, and set the view options for the window.  See Report Display Window menu.

Display Options

Display options can be set using the Options command on the Report Display Window menu.  This command displays the Report Display Window Options dialog.

Title Bar

The title bar of the report display window contains the name of the report.  It also contains the page number of the page currently being displayed, as well as the total pages of the report.  As a report is being generated, you will see the pages total increase.  The designation "processing" will also be in the title bar while the report is being generated.

Control Pad

The report display window control pad contains icons and controls for displaying pages of the report and zooming the display.


Displaying Reports on the Screen

Report Display Window Control Pad

Report Display Window Menu

Report Display Window Options


Report Display Window Control Pad

The report display window contains a control pad that enables you to select pages to display, or stop the report while it is being generated.


First Page

Click this icon to display the first page of the report.


Previous Page

Click this icon to display the previous page.


Next Page

Click this icon to display the next page.


Last Page

Click this icon to display the last page of the report.  If the report is still being generated, the last generated page will be displayed.


Stop Report

This icon is displayed while the report is being generated, and is grayed out when the report generation is complete.  Click this icon to stop the generation of the report.  You can still view the pages that were already generated.


Start (Restart) Report

Click this icon to start generating the loaded report.


Print Page

Click this icon to print the currently displayed page.


Zoom

Use the Zoom control to set the display magnification of the window.  Click this control with the right mouse button to display the report window options dialog.


Displayed Page

This area of the control pad shows the currently displayed report page.  click this area with the right mouse button to display a Go to Page dialog.


The title bar of the report display window displays the name (description) of the report, the page currently being displayed, and the total number of pages in the report.


You can use the element edit area handles to rearrange the order of elements when the report window is in edit mode.  Click on the gray rectangle on the left of the element edit box and drag it to a new position.  When a red square appears in the element handle, it means there is a filter attached to the element.


The display area of the report display window is where the report appears.  You can display the report at varying magnitudes.  Click the right mouse button in this area on the report display window to pop up the Report Display Window Options dialog.


Sending a Report to a Text File

You can convert the output of a report to text and send it to a file.  The resulting report is stripped of all formatting, including fonts, page spacing, and pagination.  The output is a standard text file that can be edited with a text editor or word processor.

Each line of text in the output file corresponds to a line of text in the report as you designed it.

Blank lines are treated according to the options specified in the report design.

Since page breaks and pagination is ignored, elements that are triggered by the page header and page footer events are ignored.  Report header, report footer, break header, break footer, and next record  events are processed.

The text appears in the same order as it is generated in the report.  Page positioning is ignored.  For example, a label report would contains labels repeating horizontally across the page.  The text file output would start each label on a new line.

Tab Options

There are two options for tabs in the text output:

Leave tabs unchanged, output a tab character to the text file

Change tabs to spaces.  With this option, you can designate the number of characters between tab stops, and each tab is replaced with the number of spaces needed to fill to the next tab stop in the current line.

To send a report output to a text file

Select the Send Report to File command on the File Menu

Select the report from the report selection list

The Send Report to File dialog will be displayed

Designate the name of the output file and set the output options

A process window will display the progress of the report output


Designing Reports

See Also	Procedures

Before you design a report, you should read the topic Understanding Reports which describes the structure and characteristics of an Ad Hoc report design.

The steps in designing a report

1.	Open a new report design window by selecting the New command on the File menu, then selecting one of the Report options.  Fill out the initial design dialogs that are automatically displayed for a new report.

To work with the design of an existing report, already saved in the database, use the Design Report command to open a window for the report design.

2.	When a report design window is active, the Report menu appears on the Ad Hoc menu bar.  This menu contains the report edit commands.  There are also pop-up menus that you can display by clicking the right mouse button on areas of the report design window.  If you click on the area of a report element, you will display the element design menu.  If you click on a tab on the ruler, you get the tab menu.  If you click on any other area of the report design window, you get a pop-up report design menu.

3.	Define the report layout and attributes with the Layout command, which displays the Report Layout dialog (or the Label Report Layout dialog if the report is a label-style report).

4.	Define the report data view with the Data View command, which displays the Data View dialog.

5.	Define the report break levels, if any, on the Sort Specification dialog, displayed with the Sort command on the Data View dialog.

6.	Define any computed fields you want.  Computed fields are defined by adding report fields on the Data View dialog.  Computed fields are defined using the Computed Field dialog.

7.	Define any counter fields you want for the report on the Data View dialog.  Counter fields are defined on the Counter Field dialog.

8.	Define the regions the report will have, using the Regions command.  Regions are defined on the Edit Report Region dialog.  See Designing Report Regions for details.

9.	Define the elements of the report, using the Elements command.  Elements are defined on the Edit Element dialog.  See  Designing Report Elements for details.

10.	Set the tabs for each report element.

11.	With the report design window in edit mode, type in the contents of each report element. (See Report Design Window View Modes)

12.  Specify the fonts to be used in the report by selecting the Fonts command on the Report menu.

13.	Design the report startup dialog, if the report has one.  See Designing a Report Startup Dialog.

14.	Select the Run Diagnostics command on the Report menu to check your design.  (See Diagnostics.)

15.	Select Report Preview mode to test the report design. (See Report Design Window View Modes)

16.	Use the Save command on the File menu to save the report design in the database.


Report Design "How To's

Understanding Reports

Report Design Window

Report Design Window

Creating a Report Quickly

Report Events

Designing Label Reports

Designing Envelope Reports

Designing Report Regions

Designing Report Elements

Setting Report Tabs

Designing Report Breaks

Specifying Page Breaks

Designing a Report Startup Dialog


Report Design Windows
Report Design Window

See Also	Procedures

A report design window is a desktop object that displays a report design (template).  You use a report design window to create a new report or change the design of an existing report.

Click on areas of the above graphic to see a short description.

Ruler

The ruler displays the tab settings for the active element (the element that contains the edit cursor) and is used to change tab settings.  See Setting Report Tabs.

Control Pad

The control pad at the top of the report design window allows you to change the window view mode, and select the display magnification.

Element Edit Area

A report design window contains an element edit area for each element of the report.  The elements are displayed in the order that they are defined on the Report Elements dialog.  When you move the edit cursor into an element edit area, the tab settings for the element are displayed on the ruler, and the name of the element and its region are displayed on the Ad Hoc status bar.  The size of the edit area for an element is determined by the size you specify for the element on the Edit Element dialog.


The title bar of a report window displays the name of the report being designed.  If a name has not been specified, it displays "untitled".


Element Edit Areas display the design of each element in the report.  The top two areas are the elements for the report title and column headings.  Click the right mouse button in an edit element area to display the element edit fast menu.


Element Edit Areas display the design of each element in the report.  The third and fourth areas contain the layout for two detail line elements.  Fields inserted in the text of an element are displayed in the element edit area as the field ID enclosed in braces { }.


Element Edit Areas display the design of each element in the report.  The bottom area contains a page footer element with two built-in fields for report date and page number.


left report margin indicator


right report margin indicator


element left margin indicator.  Marks the left margin of the active element edit area.  In Page mode, a left report margin indicator is also displayed.  You can change margins by dragging them with the left mouse button.


element right margin indicator.  Marks the right margin of the active element edit area. In Page mode, a right report margin indicator is also displayed.  You can change margins by dragging them with the left mouse button.


tab indicator.  Drag tabs with the left mouse button to change their position.  Drag a tab off the tab bar to remove it.  Click the right mouse button on a tab to display the tab fast menu, which enables you to change the alignment of the tab: left, right, center, decimal.


the tab bar of the ruler, which displays tab settings, and margins for the currently active element edit area.


the ruler scale displays horizontal measurements in inches.  Click the right mouse button in this area to display the report design window fast menu, which contains a frequently used subset of commands from the Report menu.


Click the right mouse button in this area to display the report design window fast menu, which contains a frequently used subset of commands from the Report menu.


Edit Mode

Click this icon to select Edit Mode.


Page Mode

Click this icon to select Page Mode.


Report Preview Mode

Click this icon to select Report Preview Mode.


Zoom Control

Use this control to set the scaling (magnification) of the report design window.  Click this control with the right mouse button to display the report window options dialog.


View Modes

Understanding Reports

Designing Reports Overview

Creating a Report Quickly

Report Events

Designing Report Regions

Designing Report Elements

Setting Report Tabs

Designing Report Breaks

Specifying Page Breaks

Designing a Report Startup Dialog


Report Design Window View Modes

You can select one of three view modes for a report design window, either by selecting the desired mode from the View menu when the report design window is active, or by clicking the appropriate on the report design window control pad.

Edit Mode

When the report design window is in Edit Mode, each element is displayed in a separate element edit area.  A small rectangle on the left edge of each edit area can be used as a handle to drag the element area up or down to change the position of the element in the report elements list.  If an element has a filter attached, a small red square is displayed in this handle.

In Edit Mode, the ruler displays the margins and tabs of the selected element.

Page Mode

When the report design window is in Page Mode, the entire report page is displayed.  The report regions are outlined with a gray rectangle, and the element edit areas are displayed within their assigned region.

In Page Mode, the ruler displays the report (page) margins, as well as the element margins and tabs of the selected element.

Preview Mode

When the report design window is in Report Preview Mode, the window displays the output of the report, just as it is displayed in a report display window.


Creating a Report Quickly

See Also

You can create a standard row and column report quickly by using Quick Report Setup feature of Ad Hoc.  This features generates a standard report with a title, column headings, a detail line with the fields you select, and an optional page footer with date and/or page number.  Once the report design is generated, you can use any of the report design tools to modify the report design.

Select the New command on the File menu, then select the Report (Quick Setup) option.  A series of dialogs will be displayed.

On the Quick Report Setup dialog, enter the report title and specify the desired options.   Enter a name and an ID for the report.

On the Data View dialog, designate the table from which the report will be printed, and the fields used on the report.  You can also specify a sort specification and a filter.  On this dialog, designate the database fields that not only will appear on the report, but will also be used to sort and filter the report.

On the Report Columns dialog, select the fields from the data view that will correspond to the columns of the report.  The order that you specify here is the order of the report columns, from left to right.

After the Report Columns dialog, the report layout is displayed in the report design window.

Make any additional changes using the standard design tools and dialogs.  The Quick Report Setup and Report Column dialogs are one-time only, and are not displayed again.

Save the report design with the Save command on the File menu.


Designing Reports: How To...

Designing Reports Overview

Understanding Reports

Report Design Window

Report Events

Designing Report Regions

Designing Report Elements

Selecting Fonts for a Report

Setting Report Tabs

Designing Report Breaks

Specifying Page Breaks

Designing a Report Startup Dialog


Designing Label Reports

See Also

A label report is a special type of report used for printing labels (mailing labels, name tags, shipping labels, etc.).  In general you can use a label report for any report layout that includes repeating rows and columns of a single element.  The design of a label report is automated by the Label Report Layout.  The minimum you have to do is select a label style from the Styles table on this dialog, specify the data view for the report, and layout the data fields on the report design window.  The Label Style dialog makes designing custom label formats easy.

On the report startup dialog you can select a new label style and font for that printing, and the Select First Label dialog displays a picture of the label sheet and allows you to click on the first label to print, in case some of the labels on the sheet have already been used.

To design a label report

Select the New command on the File menu, then select the Label Report option.  This opens a Report Design Window and displays the Label Report Layout dialog.

On the Label Report Layout dialog, specify an ID and name for the report.

Click the Printer Options button to specify printer settings such as paper source and orientation

Click the Edit Style button to display the Label Style dialog.  This dialog enables you to select a label style from the Styles table, or design a custom style for this report.  See the help topic for this dialog for details on selecting or designing a label style.

Click the Preview button to display the label preview window to see a picture of the selected label style.

Click the Font button to select a font for the labels.

You can optionally specify a left and top margin for the labels.  This setting determines the distance of the text from the edges of the label.

Select OK to accept the layout.  For new label reports, the Data View dialog is displayed next.

On the Data View dialog, specify the table from which the labels will be printed, and the fields to appear on the label (or that will be used to sort and filter the records).  Specify the sort specification and filter.

Select OK to accept the view definition.

The report design window for label reports displays only one element - the text area of the element.  You cannot change region information for label reports, and the Edit Element dialog is can be used to change only a few element attributes.  The options on the Edit Element dialog are set to the most common defaults for labels.

On the report design window, insert the fields that will appear on the labels into the element edit area for the label.


Label Report Layout Dialog

Label Style Dialog

Envelope Reports


Label Layout Measurements


Designing Envelope Reports

See Also

An envelope report is a special type of report used for printing envelopes. The design of an envelope report is automated by the Envelope Report Layout.  The minimum you have to do is select an envelope style from the Styles table on this dialog, specify the data view for the report, and layout the data fields on the report design window.  The Envelope Style dialog makes designing custom envelope formats easy..

On the report startup dialog you can select a new envelope style or size and address fonts for that printing. You can also select options for printing a POSTNET code and FIM.

To design an envelope report

Select the New command on the File menu, then select the Envelope Report option.  This opens a Report Design Window and displays the Envelope Report Layout dialog.

On the Envelope Report Layout dialog, specify an ID and name for the report.

Click the Printer Options button to specify printer settings such as paper source and orientation

Click the Edit Style button to display the Envelope Style.  This dialog enables you to select an envelope style from the Styles table, or design a custom style for this report.  See the help topic for this dialog for details on selecting or designing an envelope style.

Click the Fonts buttons to select fonts for the delivery address, return address, or special message to appear on the envelope.

Select OK to accept the layout.  For new envelope reports, the Data View dialog is displayed next.

On the Data View dialog, specify the table from which the envelopes will be printed, and the fields to appear on the envelope (or that will be used to sort and filter the records).  Specify the sort specification and filter.

Select OK to accept the view definition.

The report design window for envelope reports displays an element edit area for each of the address you selected to appear on the report (delivery address, return address, message).  In addition, if you selected the POSTNET option,  An additional element edit area is provided to allow you to specify the field that will be used for the zip code.  If no field is inserted in this area, Ad Hoc will look for a database field with the ID ZIPCODE or ZIP.  If the report field for the delivery zip code is not one of these, make sure you insert the proper field in the POSTNET element.

You cannot change region information for envelope reports, and the Edit Element dialog can be used to change only a few element attributes.  The options on the Edit Element dialog are set to the most common defaults for envelopes.

On the report design window, insert the database fields and text for the addresses.

If you selected the Message option, insert the fields and text for the message.

If you selected the POSTNET option, insert the field used for the delivery address zip code.


Envelope Report Layout Dialog

Envelope Style Dialog

Designing Label Reports


Designing Report Regions

Use the Regions command on the Report menu to add, change, or delete the regions of the report.  This command displays the Report Regions dialog, which contains a list of the regions defined for the report.   See Edit Report Region dialog for details on the design options for a region.

When you need to specify a region

A report must have at least one region in which information will be printed.

If the report contains a page footer, it must have a separate region for the footer to reserve space at the bottom of the page.

Whenever you want an area of the report to have a border style (such as an line under the page header) define a region for that area.

Order of regions in the Report Regions dialog

The order that you add regions in the Report Regions dialog is important in only one case:  If a region is a floating region, it must be placed in the list between the regions that are located above and below it on the report layout.

Fixed and floating regions

A fixed region is one that has a specific location and size on the report layout.  A floating region is one that extends between the region above it and the region below it on the report layout.  It's top is determined by the region above it and its bottom is determined by the region below it.  You cannot place two floating regions together.

Fixed regions have a specific location on the page relative to the report margins, and have fixed size that is either a specified measurement or is determined by the sizes of the elements assigned to the region.  Floating regions will have fixed width (regions cannot float horizontally).

Elements can repeat in a region only if it has a specified size that is large enough to hold multiple repetitions of an element or if it is a floating region that is large enough.

Use fixed regions for page headers and footers

Use a floating region for the main area where the report details lines will print.  It floats between the header and the footer regions.


Designing Report Elements

Use the Elements command on the Report menu to add, change, and delete elements from the report design.  This command displays the Report Elements dialog, which contains a list of the regions defined for the report.

See Edit Element dialog for help on the detailed design options for elements.  Use this dialog to define

The element name

The region the element will be printed in

The event that will cause the element to be printed

The size and margins of the element

The line spacing

If a page break occurs before or after the element is printed

If blank lines in the element are printed or skipped

Define a report element for each piece of information (text and fields) that:

Is printed in a different region of the report

Is printed in response to a different event

Requires its own font or tab settings

Order of elements in the Report Elements dialog

Elements are displayed on the report design window in the order they are defined on the Report Elements dialog.  The order they appear in the list is also the order that elements assigned to the same region and triggered by the same event will be printed.  For example, if you have defined an element for the report title and an element for the column headings, they both will appear in the page header region and be triggered by the page header event, so make sure the report title element comes before the column heading element in the elements list if you want the report title to be printed first.

Element size and margins

For most reports, an element is a line (or lines) of text that extends between the left and right borders of the region.  In these cases, you don't specify a fixed size for the element.  Its width is determined by the region width (usually the report page margins) and its height is determined by the height of the text (or line spacing if that is specified) times the number of lines.

Sometimes you want an element to be a fixed size.  An example is when you are designing a label report.  Specify a fixed size for an element when:

You want the elements to repeat horizontally (left to right) within a region

You want to keep the contents of the element from printing outside the element boundary

Element margins have different purposes for fixed size and non-fixed size elements:

Margins for	Fixed Size Elements	Non-Fixed Size Elements
Left and Right	determine margin within the fixed boundary of the element.	indent the element from the left and right boundary of the region
Top and Bottom	determine a margin within the fixed boundary of the element	determine the vertical spacing between repeating elements in the region
The contents of fixed-size elements are clipped (i.e. not printed) outsize the margins.  The contents of non-fixed size elements are clipped outside the left and right margins (unless you specify word wrapping) but are not affected by the top and bottom margins.

Editing the contents of an element

To edit the contents of an element, click on the element edit area in the report design window, or use the cursor keys to move the edit cursor into the element edit area.

Type in text that will appear in the element.

To insert a field value in the text, position the edit cursor at the insertion point and press the Ins key.  The Report Fields dialog will be displayed, enabling you to select a field to be inserted.

Press the backspace key to delete text and fields to the left of the edit cursor.

Press the Del key to delete text and fields to the right of the edit cursor.

To select a section of text, click and hold the left mouse button and drag it though the text to highlight a selection.  When a selection is highlighted, it is deleted by press backspace or Del.

Placing text and fields horizontally

Use tabs to locate text and fields horizontally within an element.  Do not use spaces to position text in a element, particularly if you are using a variable pitch font.

See Setting Report Tabs for help on defining the tab settings for an element

To insert a tab in the text of an element, press the Tab key

If you have defined a fixed size for the element on the Edit Element dialog, then you can also specify a left margin for the element.

Indenting Elements

Use the left and right margin settings for an element to indent the contents of the element.  If an element is not a fixed size, the indent will be from the left or right border of the region.  If an element is a fixed size, the indent will be from the left or right edge of the element.

Vertical Spacing of Elements

You can control the vertical spacing between elements within a region by specifying a top or bottom margin for the element.  For non-fixed size elements, the top and bottom margins are used to add space above or below the element.  They are in effect, added outside the boundary of the element.  For fixed size elements, the top or bottom margin is measured within the specified vertical height of the element, and affect the height available for the contents of the element.

Spacing Lines of Text in an Element

You can control the vertical placement of text in an element with the Line Spacing option on the Edit Element dialog.  If you select the automatic option, the line spacing will be determined by the size of the font, otherwise you can specify the line spacing in points.


Selecting Fonts for a Report

Use the Fonts command on the Report menu to display the Fonts dialog.  This dialog enables you to specify the font for each element of the report, plus the default report font.

You can assign only one font to a report element.  If a section of the report requires more than one font, try to break it up into several elements.  For example, If you want different fonts for the title line and column headings in the page header, create separate elements for the title and the column headings.

If several elements will have the same font, specify a default report font and check the default font option on the Fonts dialog for each of these elements.


Setting Report Tabs

Use the ruler displayed at the top of the report design window to set tab stops for an element.  Each element has its own tab settings, and when you move the edit cursor into an element's edit box, the element's tabs settings are displayed on the ruler.

To add a tab stop

Click the left mouse button at the spot in the ruler tab area where you want to place the tab

To move a tab stop

Position the mouse cursor over the tab icon, and use the left mouse button to drag the tab to the right or left, then release the mouse button.  When the button is down, a tab position window is displayed next to the cursor, showing the tab position to the nearest .001 inch.  A vertical tab line is also displayed in the affected element edit areas as you move a tab.

To remove a tab stop

Position the mouse cursor over the tab icon, click and hold the left mouse button while moving the mouse cursor out of the ruler tab area, then release the mouse button.

To change the alignment of a tab

Click the right mouse button on the tab icon to display the Tab Style menu, select one of the following tab styles:

Alignment	Tab	Description

Left Tab	Text typed after the tab will be positioned at the tab position (left aligned on the tab)

Right Tab	Text typed after the tab will be positioned before the tab (right aligned on the tab)

Centered Tab	Text typed after the tab will be centered around the tab

Decimal Tab	Text typed after the tab will be right aligned until a decimal point (period) is typed,  the decimal point will be aligned with the tab position.  Use decimal tabs only for positioning numerical data that contains decimal points


Designing Report Breaks

As records are retrieved from the database for a report, a report break happens when the value of one or more fields in a record is different from the value in the previous record.  Report breaks are used to group related records in a report, so that you can:

print a break header line before each group of records

print a break footer line, which could contain subtotals, at the end of each group of records

start a new page for each group of records

Report breaks are associated with the sort order that you have specified for the report on the Sort Specification dialog, which is called from the  Data View dialog.  Any of the fields in the sort specification can be used to define a break.  You can have multiple levels of breaks, or groups of records within groups.  You specify a report break by checking the Break option for the desired break field in the Sort Fields list on the Sort dialog.

For example, suppose a company has several divisions, and there are several departments within each division.  Employee records contain the division the employee works in (the DIV field) and the department the employee works in (the DEPT field).  If an employee report is sorted by division, and department within division, the sort fields are DIV, DEPT.

You can define a break when DIV changes, and another break when DEPT changes.  The DIV break is a higher break level than the DEPT break, because the sort order nest the record groups determined by the department within the larger groups determined by division.

When a break occurs, a break event is generated, and any elements triggered by that event are printed.  Two events are actually generated when a break occurs:

a break footer event is generated first, so that you can use it to print a footer (or total) line for the previous group of records

a break header event is generated next.  Use to print headings for the next group of records.

A higher level break generates break events for all lower level breaks;  The order of breaks is illustrated below:


Specifying Page Breaks

A page break is when a new page is started for a report.  Automatic page breaks occur when a region "fills up" and its time to print the next element for that region.

You can force a page break by setting a page break option for an element.  A frequent use of this option is when you want to start a new page when a report break happens (i.e., at the start of a new group of records), or a new page for each record.  To set a page break for an event, you must have an element that is triggered by that event.  You can specify that the next page is begun before or after the element is printed.

Specify the page break option for an element on the Edit Element dialog.

To start a new page, then print the element, set the page break on option to Before.  If several elements are printed at the same event, set the page break option for only the first element in the group.

To print the element, then start a new page, set the option to After.  If several elements are printed at the same event, set the page break option for only the last element in the group.

If you want the page numbering to start over again at 1 after the break happens, check the Set page to 1 option.

If you don't want an element to cause a break, but want it to be printed when a break occurs, check the Render on Break option.  This is not necessary for elements triggered by a page header or page footer event, since they are automatically printed at a page break.

This option is useful if the report contains group headings and you want the group heading be printed on each new page, even though it didn't change from the last page.


Designing a Report Startup Dialog

In addition to the standard features of a report dialog (see Report Startup Dialog), you can include report fields on the dialog, and set their values just before you print the report.  Include report fields on a report dialog to:

enter last minute information, such as a title or comments that will appear in the report

set values for report fields that will be used in filter rules to select specific records for the report

Including a Report Startup Dialog with a report

To include a startup dialog with the report design, check the Startup Dialog option on the Report Layout dialog.  When this option is checked,  you can select the Edit Report Startup Dialog command on the Report menu to display the report dialog.  Changes to the report dialog are saved with the report design.

Data View

A report dialog differs from a form in that it is not based on a database view.  Instead, the fields that can be placed on it are the computed fields of the report.

You can use report fields to compare against database fields in filter rules when you define the database view for the report.  (See Data View Dialog and Edit Filter Rule Dialog).  If you are going to use a report field as part of a filter rule, be sure to specify the database field that the rule applies to as the equivalent field on the Computed Field dialog.  This insures that the computed report field has the same characteristics as the database field it will be compared with in filtering.

If a report field has been defined as equivalent to a database field, you can defined table links based on the report field to other tables in the database.  This allows you to include fields from tables in the database (display-only) and lookup windows for the report fields, just as you can for database fields on a form.

For help on defining links for report fields, see Editing a Report Dialog Data View

For help on designing lookup windows, see Designing Lookup Windows

Designing the Report Dialog layout

The report dialog is a specialized version of a form and the procedures for designing the layout are the same as the ones for designing a form.  The only difference is that you are limited to a fixed area on the report dialog in which you can place controls.  You also cannot change the fonts and colors of a report dialog.

See Designing Forms for help on designing the layout of the dialog.

Saving the design of the report dialog

When you have finished designing the report dialog, select OK on the dialog.  This accepts the changes you made to the dialog as part of the report design and closes the dialog.  The dialog design will be saved along with the report design when you save it, and if you close the report design window without saving the report, the changes to the dialog will also be discarded.

If you dont want to accept the changes you have just made to the report dialog, select Cancel instead of OK on the report dialog.


Editing a Report Dialog Data View

The fields available for placing on a report startup dialog are the computed fields of the report.  The list of computed fields is similar to the root table of a database view.  Just as you can define a link from the fields of a database table to another database table, you can define a link from the report fields to tables in the database.  This allows you to include fields from these other tables on the report dialog (as display-only fields) and it also makes it possible to have lookup windows for the controls on the report dialog that contain linked fields.  Lookup windows are particularly useful if the report field is going to be used in a filter rule for the report.

To define links and select database fields to appear on the Report Dialog

Select the Edit Report Startup Dialog command on the Report menu to display the Report Dialog

Click the right mouse button on the report dialog in an area not covered by a control to display the report dialog design menu.  This is a shortened version of the Form Design menu.

Select the Data View command to display the Data View dialog

See Data View Dialog for detailed help

To design lookup windows for controls on the report dialog

Once a link has been defined for a report field, any edit control on the report dialog attached to that field will automatically have a lookup window.  See Designing Lookup Windows for help on designing a lookup window.


Data Exchange

Data exchange includes importing data into a Ad Hoc database from an external file generated by another application, and exporting data from a Ad Hoc database to an external file that will be used by another application. Ad Hoc supports data exchange to and from:

Text files in the comma separated values (CSV) format

Text files in the fixed field format

To move data from another application, you must export it from that application in one of the above formats, then import it into Ad Hoc.  To move data from Ad Hoc to another application, you must export if from Ad Hoc in one of the above formats, then import it into the other application.  Most applications support importing and exporting with the CSV format.

To import or export data in Ad Hoc, you must design a form with a data exchange template.  (See Designing Forms.)

For help on importing data, see Importing Data.

For help on exporting data, see Exporting Data.


Comma Separated Values (CSV) Format

Data can exported to or imported from an external DOS text file in comma separated values (CSV) format.  The data is structured in records, just like a database table.  Each record is divided into fields.  The fields are stored in the same order within each record, and the records are stored sequentially in the file.

Records are separated by two characters, a carriage return (ASCII code 13), and a line feed (ASCII 10).

The file is (optionally) terminated with an end-of-file character (ASCII code 26).

The fields have the same order within each record, and  are separated by commas.

Fields can vary in length.

If the field value contains a comma, the entire field is enclosed in double quotes ("..,..").

The order of the fields within a record is defined by the data exchange template.

When Ad Hoc exports data in CSV format, it encloses all fields with double quotes (whether required or not) and separates them with commas.  It also writes the end-of-file character at the end of the file.


Fixed Field Format
Fixed-Field Format

Data can be exported to or imported from an external DOS text file in fixed-field format.  The data is structured in records, just like a database table.  Each record is divided into fields.  The fields are stored in the same order within each record, and the records are stored sequentially in the file.

Records are separated by two characters, a carriage return (ASCII code 13), and a line feed (ASCII 10).

The file is (optionally) terminated with an end-of-file character (ASCII code 26).

Each record is the same length (number of characters).

The fields are identical in length and position within each record

The order and size of the fields within each record is defined by the data exchange template.


Importing Data

To import data from an external file into a Ad Hoc database, you must design a form with an attached data exchange template.  The data view of the form must contain the same fields that are in the external file.  The same data exchange template can be used for both importing and exporting, however only the fields that belong to the root table of the data view can be imported.  Other fields in the import record are ignored.

To design a data exchange template, see:

Designing Data Exchange Templates

Designing Forms

The data view of the form defines which fields from the database can be updated when an import record is read.  The data exchange template defines how data in the import record matches the fields in the data view.

Restrictions on importing data

You can change data fields in existing records in the root table of the data view associated with the form only if the imported records contain the field(s) that is the root table's primary key.

You can add new records to the root table of the data view only if the imported records contain the field(s) that is the table's primary key and all of the table's required fields are contained in the imported records.

If you attempt to import two records with the same value in the primary key field(s), the first record will be added to the table (assuming a record with the same key does not already exist), and the second record will be treated as an update to the first.  You should make sure there are no duplicate primary key values before importing.

To import data from a file

1.	Display the form that contains the data exchange template designed for the record format of the external file.

2.	Select the Import command on the Form menu to display the Data Import dialog.

3.	Enter the name of the external file that you are importing, along with the other options on the dialog, then press Enter or click the OK button.

4.	Ad Hoc will display the progress of the import process in a process window.

5.	If an error is encountered in an input record, the record will be displayed on the form for you to edit.  You can either correct the error and use the update command to import the record, or use the cancel command to discard the record.  If you have specified a suspense file, the discarded record will be added to the suspense file for later editing and import.

6.	When the import process is completed, click the OK button in the process window to close it and terminate the import process.


Exporting Data

To export data from a Ad Hoc database to an external file, you must design a form with an attached data exchange template.  The data view of the form must contain the fields that you want in the exported records in the external file.  The same data exchange template can be used for both importing and exporting, however all fields in the view will be exported, including fields from linked tables.

To design a data exchange template, see:

Designing a Data Exchange Template

Designing Forms

The data view of the form defines which fields will be read from the database.  The data exchange template defines how the data in those fields will be placed in the export record.

To export data to a file

1.	Display the form that contains the data exchange template designed for the record format of the external file.

2.	Select the Export command on the Form menu to display the Data Export dialog.

3.	Enter the name of the external file that you are exporting to, along with the other options on the dialog, then press Enter or click the OK button.

4.	Ad Hoc will display the progress of the export process in a process window.

6.	When the export process is completed, click the OK button in the process window to close it and terminate the export process.


Designing Data Exchange Templates

Data exchange in Ad Hoc is implemented by importing and exporting records through a form.  A form contains the means of reading and writing records to the database.  By attaching a data exchange template to the form design, you can use the form to import (read) records into the database from an external file, or export (write) records from the database to an external file.  When you import records, you can use the form to display and edit them before they are stored in the database.

A data exchange template describes how the fields in the data view of the form are "mapped" to the data in the records of the external file.  Not all of the fields in the data view need to be defined in the data exchange template - only the ones you want to import or export.

There are some restrictions to importing data that you must be aware of when designing a template that will be used for import:

Only fields from the root table of the data view can be updated in the database, so only these fields will be imported.

An import record must contain the fields of the primary key of the root table.

If import records are to be used only to update information in existing database records, they need only contains the primary key field(s) and the fields to be updated.

If import records are to be used to add new records to the database, they must contain, as a minimum, the primary key field(s) and all required fields of the root table.

Only certain date formats available to data exchange templates can be used for importing.  See Data Exchange Template dialog.

To design a data exchange template

1.	Use an existing form, or design a new form for the data exchange process.  See Designing Forms.

2.	Put the form in design mode with the Design Mode Command on the Form Menu.

3.	Design the data view.  The data view of the form must contain all the fields to be imported or exported.

4.	If the form will be used for importing, there should be a control on the form for each field in the root table that will be imported.  This will allow editing of errors in the import record.

5.	Check the Data Exchange Template option on the Form Attributes dialog.

6.	Select the Data Exchange Template Command on the Form Design menu (or click the DX Template button on the Form Attributes Dialog) to display the Data Exchange Template dialog.

7.	Select the record format of the external file, and the other options on the Data Exchange Template dialog.

8.	Click the Layout button to display the DX Record Layout dialog.   Use this dialog to define the mapping of data in the records of the external file to the fields in the form's data view.  See DX Record Layout Dialog for details.

9.	If you are designing a template to import from an existing external data file, you can use the Sample Record feature on the DX Record Layout dialog to display a sample from the file to help design the layout.

10.	If you are designing the template to export data, you can define the sort specification and filter of the data view to determine the order and selection criteria of exported records.  See Defining Data Views.

11.	When you have designed the template, take the form out of design mode with the Leave Design Mode command on the Form Design menu.

12.	Save the form design with the Save command on the File menu.

13.	Test the design by exporting to a sample output file.  If the template is to be used for importing, verify that the output sample records match records that will be imported.


Getting Started

If you are a new user of Ad Hoc, getting started can be frustrating, particularly if you don't have previous experience with building and using databases.  The following topics will help you understand what Ad Hoc does and how you can apply it to your data management needs.

What is Ad Hoc?

Basic Concepts

Features of Ad Hoc Help

Learning to use Ad Hoc

Introduction to Databases


What is Ad Hoc?

Ad Hoc is a database management system - a program that allows you to organize and store data, and then retrieve it either on screen or in printed reports.  It can be used for simple applications, such as mailing lists, or more complex applications such as  customer information systems, product inventory systems, etc.

Ad Hoc lets you organize data and store it on your disk

Data is stored on your hard disk in a database, which is the total collection of all your data along with the definition of how it is structured.  The first step in using Ad Hoc is to decide what data you want to store, and how you want to organize it.  This determines the structure of your database, which is defined in the database's data dictionary.

Ad Hoc provides ways for you to enter data into the system

The primary way of getting data into the database is by typing it in using data entry forms.  A form is like a dialog box in any windows program, where there is a space to enter each data item.  You design the forms in Ad Hoc.  You can have as many forms as you like, and tailor them to a particular purpose.  For example, you may have a form for business contacts, that contains all the information you store on your contacts.  This form would be used to enter all the information for a new contact.  You may have another form containing just the address of the contact.  This form might be used to update address information for contacts in your database.

Ad Hoc lets you retrieve data in meaningful ways

A mass of data is no good unless you can retrieve it in a useful format.  There are several ways of getting data out of Ad Hoc.  You can design on screen-displays of data, either as display-only forms, or scrolling lists, that display your data in a row and column format.  You can also design printed reports.  Reports can also be displayed on the screen, either in a preview mode, which shows you what it will look like on the printed page, or in a format more tailored to the size of the screen.  List and report formats are also saved in the database for easy retrieval when you need them.

Ad Hoc also lets you export data from the database into formats that can be read and used by other programs.


Basic Concepts

Ad Hoc is a standard Windows program, and the documentation from Ad Hoc uses standard terminology for Windows.  If you are unfamiliar with Windows in general, you can refer to the Microsoft Windows User's Guide.  Ad Hoc is a multiple document interface program, which means that you can open smaller document windows within the main program window.

In Ad Hoc, the area of the main program window is called the Ad Hoc desktop.  On this desktop, you can open a number of document windows that we will refer to as desktop objects.  There are several types of desktop objects in Ad Hoc:

Forms	data entry windows

Lists	data display windows in scrolling row and column format

Report Design Windows	windows in which you can design a report

Report Display Windows	windows that display a report output

Tables Window	a window that lists the tables in your database, and allows you to change a table design or perform maintenance on a table

Process Windows	process window display the progress of a background process, such as a sort, a table rebuild, or a data exchange operation

To use Ad Hoc, you must first open a database.  When a database is open, you can work with the database by opening forms on the desktop to enter data, designing and printing reports, etc.  You can create as many databases as you want.  Usually a database contains all the information relating to a particular application.  If you are using Ad Hoc to store your personal information, (address lists, household inventory, etc.) you probably would keep all this information in one  database.  For a more detailed discussion of database terminology and concepts, see Introduction to Databases.

The commands on the File menu enable you to open and work with desktop objects.  With these commands you can start designing a new form, list or report, or open an existing object to use.

The commands on the Options menu allow you to tailor the way Ad Hoc works.  When the Tables Window is open, the commands on the Tables menu allow you to design and maintain the structure of your database.

Information in a database is stored in tables.  A table in Ad Hoc is represented physically by a file on your disk.  A disk file corresponds to each table in your database.  There are four files, called system files in Ad Hoc, that are contained in every database.  The names of these files depends on the ID you assigned when you created the database.  The first of these files is the file that contains the data dictionary.  The other three correspond to system tables that you will see listed in the Tables Window.

The system tables are:

_DDDATA	extra data dictionary information, such as field validation rules

_FORMS	form and list designs, saved desktop layouts

_REPORTS	report designs

The system files must all be in the same directory on your disk.  All other database files correspond to the tables that you define in the database, and can have any valid file name and be located in other directories or on other disks.


Features of Ad Hoc Help

See Also

(If you are unfamiliar with using on-line help in a Windows program, select the How to Use Help command from the Help menu at the top of this help window.)

The Help System for the current version of Ad Hoc serves the following purposes:

It is the User's Manual for Ad Hoc, taking the place of printed documentation

To help you learn how to use Ad Hoc

To help you perform a procedure with step-by-step instructions

To define the function of a menu command, dialog, or Ad Hoc desktop object

To provide a quick reference while you use Ad Hoc

Some of the special features that you should be familiar with are:

"See Also" Lists

In the title area of many topics, you will see a jump to another topic labeled "See Also".  Click this topic jump to view a pop-up list of other topics related to the one you are reading.  Issues referred to the topic you are reading may be covered in greater detail in a related topic.  Some topics also have a jump labeled "Procedures" in the title area.  This displays How To help related to the topic you are reading.

Graphic Hot Spots

Some topics contain pictures of Ad Hoc screens or other graphics.  When you move the mouse cursor over these graphics, there are areas where the cursor changes to the shape of a hand.  Click on these "hot spots" to view a pop-up description of the object or area in the graphic under the cursor.

The Glossary

The Glossary is displayed in a separate Glossary Window, so that you can keep it open as you read help to look up definitions of terms.  Use this feature to look up terms in the help text that don't have pop-up definitions.

Click on "Glossary" topic jump in the Reference section of the Help Contents topic to display the glossary in the main Help Window

Click the Glossary button on the Help Window button bar to display the Glossary in a separate window.

"How To" Help

The "How To" feature of Ad Hoc help is designed to help you quickly find the steps to perform a task.  How To topics are displayed in a separate window from the Help Window so that you can view the steps of a task in one window and detailed help on the task in the main window.  How To topics are colored dark red to distinguish them.  They are organized into related groups, and when you click on a How To topic, it is displayed in a pop-up window.

Click on the "Procedures" topic jump in the Reference section of the Help Contents topic to display How To topics in the main Help Window.

Click on the Procedures button on the Help Window button bar to display How To help topics in a separate window.

How To topics are meant to contain a short list of steps to carry out a task. Some of them help with tasks not covered in a main help topic.  Some are abbreviates of steps to perform a task and will refer to details in a main help topic.

How To topics contain topic jumps to main help topics in order to define a concept or refer to a more detailed explanation.  When you select one of these jumps, the main help topic is displayed in the main help window to allow you to quickly return to the How To topic.


Help Menu

Glossary Window

"How To" Window


Learning to Use Ad Hoc

The best way to learn how to use Ad Hoc is to read the User's Manual, which is this help system.  Of course, if you are like most people, you don't like to read manuals cover to cover, particularly if they are on-line and you can't find the covers.  So here are some alternate steps you can take to get started.

Read all the topics in the Getting Started section, to get familiar with the general concepts in Ad Hoc.

Starting at the Contents topic, browse the first topic of each of the main sections on databases, forms, lists, reports, etc.  To get familiar with where you can find information on a topic you need help on.

Play around with the sample database that comes with Ad Hoc.  Make a backup copy of the files in the ADHOC\DATA directory so you can restore the original state of the sample database, then start working with it.  Add data and print reports.  Change the design of the forms, create your own forms and reports, change the data dictionary, add your own fields and tables.

Try out all of the commands on the main menu bar.   When you drag the mouse over a menu selection, a short description of the menu command is displayed on the status line.  To display help on a menu command, open the menu by clicking on its title on the main menu bar, then use the cursor keys to move the highlight to the menu command you want help on.  Press the F1 key to display help on the highlighted command.

As you are working with the sample database, use the Help on Procedures references to find out how to perform a particular procedure.

After you have beat the sample database to death, create your own database and practice with data that is meaningful to you.


The Ad Hoc Main Window

See Also	Procedures

When you start Ad Hoc, the first window that you see is the Ad Hoc Main Window.

Click the mouse on the areas of the Ad Hoc window above to see a definition of each component of the main window.

The main area of this window (called the client area in Windows terminology) is referred to in Ad Hoc as the desktop.  Ad Hoc displays various desktop objects on the desktop, including data entry forms, lists report design windows,  and the Tables Window.


Menu Commands

Configuration Options

Tables Window

Getting Started


Window Title Bar

This area displays the application name, Ad Hoc, and if a database is open, the name of the database.


Main Menu

The main menu of Ad Hoc, contains the commands you use to open and work with databases, forms, and reports.


Desktop

The Ad Hoc Desktop, on which appear the desktop objects: forms, reports, the table status window, etc.


Status Bar

The status bar displays the state of various system wide options on the right, and status messages of the active desktop object on the left side.  When you are dragging the mouse across a menu, the status bar displays a description of the menu selection that is highlighted.


Design Mode Indicator

If the currently active form is in design mode, this area will display the word "DESIGN".


Record Locking Indicator

If record locking is in effect, this area will display "RL".


Data Change Notice Indicator

This area of the status bar will display "DBC"  (for Database Change) if the data change notification option is set.


Calendar Lookup Window

The calendar lookup window is a special type of lookup window that is attached to edit controls that contain a date field (the field was defined with the Date data type). You can use the calendar lookup window to select and enter a date into the field.

To display the calendar lookup window when the focus is on a date field:

click the [image] icon

or

click the right mouse button on the field

 	or

press Ctrl-<up arrow>

If the field contains a valid date, this date will be show selected in the calendar window, other todays date will be selected.

To select a date and close the calendar window

Click on the date or use the arrow keys to select the date, then select OK

or

Double-click the date to select it and close the window

The selected date will be placed into the edit control.

To close the calendar window without selecting a date

Select Cancel

Navigating the calendar

There are many ways to display and select dates with the calendar window

Year buttons

Two buttons at the top of the calendar are labeled with the previous year and the next year relative to the displayed year.  Click on one of these buttons to display the calendar for the same month in the indicated year.

Month buttons

Two buttons are labeled with the previous month and the next month relative to the month being displayed.  Click on one of these to display the indicated month.

Keystrokes

If you start typing a date, a Go To Date dialog will open, finish typing the date and select OK to move the selection to that date.  This also applies to special codes for dates.  For example, if you type today and press Enter, that will highlight the current date.  See Date Field for help on entering dates.

Keystroke	Moves the selection to relative to currently selected date

up arrow	same day in the previous week

down arrow	same day in the next week

left arrow	previous day

right arrow	next day

PgUp	same date in the previous month (if it exists)

PgDn	same date in the previous month (if it exists)

Ctrl-PgUp	same date in the previous year

Ctrl-PgDn	same date in the next year

Home	todays date

Pop-up Menu

Click the right mouse button on the menu to display a pop-up menu. The commands on this menu are:

Command	Action

Today	moves the selection to todays date

Go To Date..	displays the Go To Date dialog.  Enter a date and press ENTER to move the select to the specified date.


Go To Date Dialog

This dialog is displayed when you select the Go To Date command on the calendar window.  Enter the date that you want to select on the calendar.  See Date Field for available date entry formats.


Process Window

A process window is used to display the progress of a process.  A number of processes in Ad Hoc occur in the background (you can do other things while the process is running) and the process window enables you to keep track of and control long processes.

Some of the processes that use a process window are:

Rebuilding table files and converting data formats when you change a table definition

Importing data

Exporting data

Sending a report to a text file

A process window displays a description of the process, the status of the process, and some indication of its progress.

Progress gauge

If the length of the process can be determined, a gauge is displayed graphically depicting the percent complete.  This is not always possible, as when records are filtered and there is no way of knowing how many will pass the filter.  In these cases, the gauge area displays the message Processing....

Counters

The progress window has an area for several counters that show information such as the number of records processed, the number of errors encountered, etc.

Minimized process window

While a long process is running, you can minimize it to an icon on the Ad Hoc desktop.  While it is an icon, it will still display its status (see below) and usually a percent complete or some other count..

Starting a process

A process is usually started when you select a menu command.  Some processes start immediately, and some may display the status message Ready to start.  In the latter case, select OK (click the OK button or press ENTER) to begin processing.

Canceling a process

For most processes, you can cancel them at any time by selecting Cancel (clicking the Cancel button or pressing ESC).

 Status

The progress window displays one of these status messages

Status	Description

Initializing	The process is initializing (opening files, etc.

Ready to Start	Select OK to start the process

Processing...	In progress

Paused	Some processes may display a Pause button.  Click on Pause to temporarily pause the process.  When the status is Pause, the Pause button becomes the Resume button. Click on Resume to continue the process

Waiting for User Input	The process is stopped, waiting for some user action (for example waiting for the user to correct an record during data import.

Waiting for locked record	Another process or form has locked a record.  When the lock is released, the process resumes automatically.

Waiting for resource	The process is blocked waiting for some other system resource currently in use

Completed	The process completed successfully

Canceled by user	The user aborted the process before it was completed

Canceled - <error>	The indicated error caused the process to be canceled

The following messages are displayed when the window is an icon

RUN	Processing

STOP	Paused or waiting

END	Completed

Priority

The priority option allows you set a priority level for the process.  The effectiveness of this control depends on the process and what else might be going on in Windows.

For most processes that are reading records from a file, the priority number is the number of records that are read and processed before the process relinquishes control to Windows for message traffic and other processes that might be going on.

A lower the priority number makes Windows more responsive to user inputs, and the process runs somewhat slower

A higher number makes Windows less responsive to user inputs, and the process is somewhat faster.


Printer Options Dialog

Use the Printer Options dialog to set configuration options for a printer or select a new printer or print driver.  This dialog is used in three places:

When called from	Scope of settings
Printer Setup command on the File Menu	Selected printer and settings are used as the default for all printing while in Ad Hoc.
Printer Options button on Report Layout dialogs	Paper source, size, and orientation settings are saved with the report design
Printer Options button on Report Startup dialog.	Selected printer and settings override the defaults for the current report
Current Printer

Select the printer to use when you print a report.  Only printers attached to active ports in your system are included in this list.  When you are designing a report, selecting a printer allows you to see the paper and orientation options for different printers, however the selected printer is not saved with the report design.

Paper Source

Select Default to use the paper source  that is currently set on the printer, or select a specific source to use for a report.

Orientation

Select Portrait or Landscape orientation.

Show only options available for selected printer

Check this option when you are designing a report to view the paper sources (trays) and sizes supported by a particular printer.  When this option is not checked, the paper source and size options display a wide range of settings for all printers.

Setup

Select Setup to display a configuration dialog specific to the selected printer.


Print Image Offsets Dialog

Use the Print Image Offsets dialog to adjust the position of the printed image of a report on the paper.  Use this dialog only if the position of the printed image on the page does not match the measurements you specified in the report design.  The settings on this dialog do not configure the printer, but are used to move the print image on the page.  You may need these adjustments if the paper tray of your printer is out of alignment or if you are printing on a paper size (e.g. an odd-size envelope) that your printer doesnt recognize.

Alignment for Custom Paper Sizes

This option may be needed if the paper size you are using is not supported by the printer, and the position of the paper in the tray is different from that expected by the program. In most cases, Ad Hoc can compute the correct print image offsets for custom sizes based on the paper source (tray) being used and the orientation (portrait or landscape) of the printed output. You should set the Based on selected printer option unless this default option is not correct for a particular printer.

Option	Description

Based on Printer	The default options are computed based on the assumption that the printer will align the paper in the center of the Manual Feed tray and on the left side of all other paper feed trays.

Force Left	Force Ad Hoc to assume that the paper is always aligned on the left side, regardless of the printer or paper source option.

Force Center	Force Ad Hoc to assume the paper is always centered in the tray.

Force Right	Force Ad Hoc to assume the paper is always aligned on the right side of the tray.

Landscape Compensation

This setting is used only when printing in landscape orientation on a paper size that is not supported by the printer.  It is used to determine whether the image should be moved to the left or the right to compensate for the different paper sizes.

When a report is being printed in landscape, some printers will feed the left side of the paper first (e.g. dot matrix printers) and some will feed the right side first (e.g. laser printers).  This difference is important when you are printing on envelopes or pre-printed forms.  In most cases, you should leave this setting on the Based on selected printer option, because Ad Hoc can determine the landscape rotation from the printer driver.  In some cases, you may wish to override the default with one of the other options.

Option	Description

Based on Printer	The information provided by the printer driver is used to determine whether the landscape rotation is left side or right side first.

Right Side First	Forces Ad Hoc to assume that the landscape rotation is right side first.

Left Side First	Forces Ad Hoc to assume that the landscape rotation is left side first.

Additional Offsets

Use these settings to specify print image offsets for the horizontal and vertical directions that will be added to the measurements specified in the report design.  These offsets are applied regardless of whether or not you are using a custom paper size.  They affect the layout of the report as it is read (i.e. they are independent of the paper orientation in the printer).

A positive horizontal offset moves the image to the right

A negative horizontal offset moves the image to the left

A positive vertical offset moves the image down

A negative vertical offset moves the image up

Save As Defaults

Select this option to save the current settings on this dialog as the defaults for your system.  You can specify image offsets for a particular report.  If several reports will use the same set of offsets, you can save a default configuration.

Load Defaults

Select this option to load the saved defaults into the dialog.

Clear

Select this command to clear all the settings on the dialog.


Contents

Registration and License Information

Features of Ad Hoc Help

Getting Started

The Ad Hoc Main Window

Databases

Forms

Lists

Reports

Data Exchange

Database Maintenance

Reference

Procedures  (How To's)

Menu Commands

Keyboard Reference

Glossary

Technical Support and Questions


Registration and License Information

This program is SHAREWARE, it is not free!

You are authorized to use this evaluation version of Ad Hoc for a period of 60 days.  If you use the program after the 60-day evaluation period, you are required by law to register your copy and pay the registration fee for a license to use the software.  Your use of the product, even during the evaluation period, means that you agree to the terms of the software license agreement.

Benefits to Registering

How to Register Ad Hoc and Order Copies

Software License Agreement

Limited Warranty


Benefits to Registering

We hope you like Ad Hoc and will continue to use it after the evaluation period.  If you continue to use Ad Hoc after the evaluation period, you must register your copy and pay the registration fee to avoid being in violation of Federal copyright laws.

The additional benefits to registering your copy are:

You will receive a registered copy of the product ( the retail version) without the "Unregistered Copy" notice , report watermarks, and other reminders.

You will receive a printed User's Manual.

You will be eligible for telephone technical support.

You will be notified of the availability of future updates, and will be offered upgrades at a substantial discount.

The registered version of Ad Hoc contains features that are not in the evaluation version.

You will be able to contribute to the design of future releases with your comments and suggestions.  We thrive on the suggestions and requests of our users.

By purchasing a license to use Ad Hoc, you will help make it possible for us to continue to improve the product.


How to Register and Order Ad Hoc
How to Register Ad Hoc and Order Copies

You can order registered copies of Ad Hoc by mail, fax, or telephone. Send (mail or fax) the completed order form to:

ExLogica
59 Golden Eagle Lane
Littleton, CO 80127-5750
USA
fax (303) 933-1075

The registration fee for Ad Hoc is $69.95 plus shipping and handling.  See the order form for details.

Mastercard and Visa accepted.  Payment by check or money order must be in US Dollars.

Developers:  If you are a database application developer and want to use Ad Hoc to develop applications for others, please contact us about a developers license.

For information on ordering, quantity discounts, site licenses, or obtaining upgrades to the product, write the above address, or contact ExLogica at:

Telephone 	(303) 933-8553

Fax	(303) 933-1075

Compuserve	75136,1033

Internet	75136.1033@compuserve.com

Other information services: use the Internet gateway


Software License Agreement

See Also

By installing and using this software, you agree to the following license agreement between yourself and ExLogica.  You should carefully read the following terms and conditions, and if you do not agree with them, do not use the software.

SHAREWARE version of Ad Hoc

The SHAREWARE version ("evaluation version") of Ad Hoc contains the title "Unregistered Ad Hoc" in the main window caption bar and the words "Evaluation Copy" in the main window client area.  This is the only version of Ad Hoc that may be distributed as SHAREWARE.  Other versions of Ad Hoc without this designation are retail versions (registered versions) that may be used only by licensed (registered) users.

Use of Software

The file VENDINFO.DIZ, which is part of the Ad Hoc distribution file set, contains the license agreement for use and distribution of this evaluation version of Ad Hoc.  Please refer to that file for details on use and distribution license terms.  Following is a summary of the license permissions for use of Ad Hoc.

You are hereby authorized to:

Use the evaluation version of the software for a 60-day evaluation period.

Make as many copies of the evaluation version of this software and documentation as you wish, as long as the copies include all of the files distributed in the evaluation package.  See the file VENDINFO.DIZ for details.

Give exact copies of the original evaluation version to other individuals for their evaluation.

You are specifically prohibited from charging, or requesting donations, for any such copies, however made; and from distributing the software and/or documentation with other products or services (commercial or otherwise) except as specified in the file VENDINFO.DIZ.

You may not use Ad Hoc after the evaluation period without first registering your copy and paying the license fee.  Unregistered use of Ad Hoc after the evaluation period, by any person, business, corporation, government agency, or any other entity, is strictly prohibited and is in violation of federal copyright laws.

You may not modify or patch the Ad Hoc executable files in any way.  You may not decompile, disassemble, or otherwise reverse engineer the software in this product.

Developing Applications for Others

You may not use the evaluation version of Ad Hoc to create database applications (database designs, forms, and reports) for others.  If you intend to develop applications for another party, you must first register your own version of Ad Hoc.  You may then create applications for other registered users of Ad Hoc, subject to the terms of the Software License Agreement for the registered version of Ad Hoc.

In any event, you may not sell or distribute Ad Hoc database, form, or report designs to others unless they are registered users (have purchased a license to use a registered version) of Ad Hoc.

You may not sell or otherwise distribute enhancements to the Ad Hoc evaluation version without written permission from ExLogica.

SHAREWARE Distribution

Please refer to the file VENDINFO.DIZ, which is part of the Ad Hoc distribution file set,  for information regarding the license for distribution and sale of Ad Hoc by BBSes and other shareware distributors and vendors.

U.S. Government Restricted Rights

Use, duplication, or disclosure by the Government is subject to restrictions as set forth in subdivision (b)(3)(ii) of the Rights in Technical Data and Computer Software clause at 252.227-7013 (DFARS 52.227-7013).  Contractor/manufacturer is ExLogica, 59 Golden Eagle Lane, Littleton, CO 80127.

Evaluation and Registration

Ad Hoc is not free software.  This license allows you to use the software for evaluation purposes without charge for a period of 60 days.  If you use this software after the evaluation period, you must register it and pay the license fee.

This license agreement is governed by the laws of the State of Colorado.


Limited Warranty


Menu Commands Reference

File Menu

Edit Menu

View Menu

Options Menu

Report Menu

Database Menu

Tables Menu

Window Menu

Help Menu

Form Menu

Form Design Menu

Form Control Design Menu

List Menu Commands

List Design Menu


File Menu

Command Summary	Save Desktop	Design Report
New	Read From File	Delete Report
Open	Save To File	Database
Close	Print Report	New Database
Delete	Display Report	Exit
Form Links	Send Report to File
Save	Printer Setup


Edit Menu

Command Summary


View Menu

Command Summary


Options Menu

Command Summary

Desktop Configuration

Database Options

Confirmation Options

FastMenu Options

Diagnostics Options


Database Menu

Command Summary

Open Database

Close

Create New Database


Tables Menu

Command Summary	Empty Table File
New Table	Update Tables Window
Edit Table Definition	Display System Tables
Delete Table	Run Database Diagnostics
Edit Database Information	Run Table Diagnostics
Rebuild Table File


Report Menu

Command Summary	Regions
Data View	Insert Field
Layout	Options
Fonts	Run Diagnostics
Edit Startup Dialog	Print
Elements


Window Menu

Command Summary


Help Menu

Command Summary


File Menu Command Summary

New

Creates a new desktop object.  Desktop objects include forms, lists, and reports.  An empty window for the object is opened on the desktop.  You use the pop-up design menu for the object to design its layout, data view, etc.

Open

Opens an existing form, list, desktop layout, or report design stored in the forms table.

Close

Closes the active object on the desktop.

Delete

Deletes a form, list, or desktop layout from the database.

Form Links

Links the active form or list to other forms or lists on the desktop.  The active form becomes a master to the linked forms, controlling the data that is displayed in the linked form.

Save

Saves the design of the currently active desktop object in the database.  This command saves forms, lists, or report designs.

Save Desktop

Saves the current layout of the desktop.  The desktop layout is saved under a unique ID that you can use later to recall the layout.  The layout saved includes all forms and lists currently on the desktop, their current size and position on the desktop, and all links defined between them.

Read From File

Reads a desktop object (form, list, or report) from a DOS file and loads it onto the desktop.

Save To File

Saves a desktop object (form, list, or report) to a DOS file.

Print Report

Prints a report selected from the reports table.

Display Report

Display a report on the screen in a Report Display Window.

Send Report To File

Output a report as a text file.

Printer Setup

Selects and configures a printer connected to your system that will be used by Ad Hoc to print reports.

Design Report

Opens a report design window for a report that has been stored in the reports table.

Delete Report

Deletes a report design stored in the reports table.

Exit

Closes all open desktop objects and exits Ad Hoc.

When no database is currently open, most of the above commands do not appear on the file menu, and the following commands are added.  A list of the most recently opened databases (up to four) appears at the bottom of the menu.  To open one of these databases, select its entry.

Open Database

Opens a database.  This command appears on the File Menu only when there is no database currently open

New Database

Enables you to create a new database.  This command appears on the File Menu only when there is no database currently open.


New Command  (File menu)

Use the New command on the File menu to create a new desktop object.  This command displays a dialog containing a list of the types of objects you can create:

Object Type Description
Form	A data entry form with edit controls for editing records.  Each control on the form displays a field from the view associated with the form.  A form displays one record at a time.
List	A scrolling list that displays several records at a time.  Each column of the list corresponds to a field in the view associated with the list.
Report (Quick Setup)	A report design window, with a Quick Report Setup Dialog that helps you quickly set the basic design for a standard report style.
Label Report	A report design window customized for label reports
Envelope Report	A report design window customized for envelope reports
Report (custom design)	A report design window with no quick setup, so that you can create a custom design from scratch.
To select a new object type from the dialog, double click on the desired type, or use the cursor keys to highlight the desired type, then either click on the OK button or press the ENTER key.

To put away the dialog without selecting an object, click on the CANCEL button, or press the ESCAPE key.

When you select an object type, a new object of that type will be displayed on the screen.  You can then design the layout, database view, and other attributes of the object and then save it in the database.


Open Command  (File Menu)

Use the Open command on the File menu to select a form, list, or desktop layout and open it on the desktop.  When you select this command, Ad Hoc displays the Open dialog.  This contains a list of the forms, lists, and desktop layouts stored in the database. Check boxes below the list allow you to select the types of objects that will appear in the list.

To select and open an object, double click on the list entry, or highlight the entry in the list and either press the ENTER key or click the OK button.  To close the Open dialog without selecting an object, press the ESCAPE key, or click on the CANCEL button.

Forms and lists will be displayed on the desktop at the position and with the size they were given when designed.  If you open a desktop layout, the objects will be displayed with the size and position they had when the desktop was saved.


Close Command  (File Menu)

Use the Close command on the File menu to close the currently active desktop object.  The active desktop object is the one with the highlighted border and title bar that is responding to keyboard input.  If you have changed the design of the object since it was last saved, Ad Hoc will ask you if you want to save the object (Form, List, Report, etc.).  Your response to this can be:

Response Action
Yes	The object design changes will be saved in the database and the object will be removed from the desktop.
No	The design changes to the object will not be saved.  The object will be removed from the desktop and the design changes will be lost.
Cancel	The object will not be removed from the desktop, changes will not be saved.


Delete Command  (File Menu)

Use the Delete command on the File menu to delete a form, list, or desktop layout from the database.  When you select this command, Ad Hoc displays the Delete dialog, containing a list of the forms, lists, and desktops stored in the database.  Below the list are check boxes that you can use to select the type of objects that appear in the list.

Double click on the entry in the list that you want to delete from the database, or highlight the entry and either press the ENTER key or click the OK button.  Press the ESCAPE key or click the Cancel button to close the dialog box without deleting an object.

When you select an object, Ad Hoc will ask you if you want to delete it.  Respond Yes to delete the object, No to leave it in the database.

Warning:  When you delete an object from the database, it cannot be retrieved, unless you have made a backup of your database


Form Links Command
Form Links Command  (File Menu and Form Menu)

Use the Form Links command to display the forms or lists that are linked to the currently active form (or list), and to edit the links.  This command will link two forms together so that the contents of the record displayed in one form (the master form) controls the records that are displayed in the other form (the linked, or dependent, form).  The Form Links command can also be used to edit an existing link between two forms or to remove a link.

You can link together two forms or lists on the desktop to display related information. Any two forms or lists on the desktop can be linked together if their data views share common fields.  For example, suppose in an order entry system that the Customer Master form is displayed on the desktop, and as you work with the customer records you wish to see a list of recent orders for the customer.  You could open a list on the desktop that displays records from the Order file, and link this list to the Customer Master form so that only orders for the customer record displayed on the Customer Master Form appear in the Orders list.  If this were a configuration that you used often, you could save it as a desktop layout in the database.

To link two forms (or lists)

1.	Make sure that both forms are open on the desktop.

2.	Make sure that the form or list that is to be the master is active.  (One way to do this is to click on it. )

3.	Select the Form Links command.

4.	Describe the link on the Form Links dialog.

5.	Close the dialog with the OK button or by pressing ENTER.

The forms will be linked until you remove the link with the Form Links command, or until one or both of the forms are closed.


Save Command  (File Menu)

Use the Save command when you have designed a new desktop object (form, list, report, etc.) or have changed its design and want to save it permanently in the database for later use.  When the design of a desktop object has changed, or the object is in design mode, the Save command will be enabled.  When it is selected, the currently active object's design is saved in the database under the ID that you gave it.

The Save Command applies to the following desktop objects:

Object Type Saved in Table ID specified on
Form	_FORMS	Form Attributes dialog
List	_FORMS	List Attributes dialog
Report	_REPORTS	Report Layout dialog
Before you can save the design of an object, you must have given it a unique ID on the design dialog specified above.  Objects without IDs cannot be saved.  If another object already in the table has the ID you specified, Ad Hoc will warn you that the current object cannot be saved because it has a duplicate ID.  In this case, return to the design dialog and change the ID.

Tip

If you want to save a copy of a form, list, or report, and perhaps make some slight changes later to the copy, change the name and the ID and save it as a different object.


Save Desktop Command  (File menu)

Use the Save Desktop command to save the current desktop layout.  The desktop information saved includes the position and size of all form and list desktop objects as well as all existing links between them.

When you select this command, Ad Hoc displays the Save Desktop dialog, which enables you to enter an ID and a name under which the desktop layout will be saved.


Read From File Command   (File Menu)

Use the Read From File command on the File menu to read a desktop object into Ad Hoc from an external file and display the object on the desktop.  The object can subsequently be saved in the database with the Save command.  The only files that can be read using this command are files that were previously created using the Save to File command.

When you select this command, Ad Hoc displays the Windows Open File dialog.  Two types of files (distinguished by their filename suffix) can be read using this command:

File Type Object Type
.FRM	Forms and lists
.RPT	Reports
To read a file

1.	Enter the full pathname of the file, including the correct extension, in the File Name edit, or

2.	Select either Form Template or Report Template in the List Files of Type control.  This will display the all the files of the selected type in the current directory.

3.	Select a file by double-clicking it, or highlighting it and clicking OK (or pressing ENTER).

4.	You can use the Directories list or the Drives list to change the current directory.

When you select a file, Ad Hoc will determine that it is a valid file type, and that is consistent with the currently open database.  If these checks are successful, the file is read in and the object is displayed on the desktop.

Use this command with the Save To File Command to make a copy of an object design in a separate file that can be used at a later time either by the same database, or a copy of the database (it must have the same ID) on another machine.

Note:  Ad Hoc will display a warning message if you read a file into a different database than the one from which the file was written.  If you get this warning, make sure that the data view of the object you are loading is consistent with the new database (same tables and fields).


Save To File Command  (File menu)

Use the Save To File command on the File menu to save an object on the desktop to an external file.  Make sure the object you want to save is active, then select the Save To File command.  Ad Hoc will display the Windows File Save As dialog.  Specify the directory in which you want to save the file and enter the filename.  Ad Hoc will supply the proper extension.  If you enter a filename that is already in use, Ad Hoc will ask you if you want to replace the old contents of the file.  If you respond Yes, the old contents will be discarded and replaced by the object you are saving.  If you don't want to lose the old contents, respond No, and enter a different file name.

Two types of files are saved with this command:

File Type Object Type
.FRM	Forms and lists
.RPT	Reports
Along with the object description, Ad Hoc saves the database ID and version number, to insure that the object will be compatible with any database that tries to load it.

Use this command with the Save To File Command to make a copy of an object design in a separate file that can be used at a later time either by the same database, or a copy of the database (it must have the same ID) on another machine.

Note: objects saved with this command are saved to a DOS file.  An object is not considered saved by Ad Hoc unless you save it in the database with the Save command.


Print Report Command
Print Report Command  (File Menu and Report Menu)

Use the Print Report command on the File menu to select and print a report.  When you select this command, Ad Hoc displays the Print Report dialog, which contains a list of all reports saved in the database.  To print a report, double click on its name, or use the cursor keys to highlight the report and click on the OK button or press ENTER.  If you decide not to print a report, click on the Cancel button, or press ESC.

Before you print a report, you may want to select and configure a printer using the Printer Setup command.

To print a report that is not stored in the database but is in an .RPT file, first load the report with the Read From File command.  This will load the report design into a report design window.  You can then print the report using the Print command on the Report menu.


Display Report Command
Display Report Command (File Menu and Report Menu)

Use the Display Report command on the File menu to open a report display window .  When the report display window first opens, a Print Report dialog is displayed for you to select a report.    The selected report is generated and displayed in the report display window.

This command also appears on the Report menu, and on the fast menu of the report design window.  When you select this command from a report design window,  a  report display window is attached to the report you are designing, and can display only that report.

To display a report that is not stored in the database but is in an .RPT file, first load the report with the Read From File command and then display the report using the Display command on the Report menu.

See Report Display Window and Report Display Window Options Dialog for details on using a report display window.


Send Report to File Command
Send Report to File Command (File Menu)

Use the Send Report to File command on the File menu to send a report to a text file.  This command runs a report and converts the output to text characters.

See Sending a Report to a Text File.


Printer Setup Command
Printer Setup Command  (File Menu)

Use the Printer Setup command to select and configure a printer that will be used to print reports from Ad Hoc.  When you select this command, Ad Hoc displays the Printer Options dialog, which contains a list of printers attached to your computer.  You can change the options of the current printer or select a new printer.

The printer setup changes you make using this command are local to Ad Hoc, and will not be seen by other programs. They will be the default settings used when you print a report.  When you exit Ad Hoc, the configuration changes will be discarded.  Reports can be designed to override some of the default printer settings.


Design Report Command
Design Report Command  (File Menu)

Use the Design Report command to open a report design window and display a previously saved  report design.  This command displays the Design Report dialog, which lists all the reports saved in the database. To select a report, double click its name in the list, or highlight the report with the cursor keys and click the OK button or press ENTER.  If you decide not to open a report design, click the Cancel button or press ESC.


Delete Report Command
Delete Report Command  (File Menu)

Use the Delete Report command to delete a report design from the database.  This command displays the Delete Report dialog, which lists the reports saved in the database.   To delete a report, double click its entry in the list, or highlight it and select OK.  If you do not want to delete a report, select Cancel.


Exit Command  (File menu)

Use the Exit command to exit the Ad Hoc program.  If there are desktop objects with design changes, Ad Hoc will ask if you want to save the changes for each desktop object separately:

Respond To
Yes	Save the changes and exit
No	Discard the changes and exit
Cancel	Cancel the exit and return to Ad Hoc (changes will not be saved at this time)


Edit Menu Command Summary

The Edit Menu is a standard Windows menu that allows you to cut and paste information on the screen.  The edit menu commands operate in Ad Hoc to cut and paste text in the edit box and text box controls on forms.

Undo

Reverses the last cut, copy, paste, or delete action.

Cut

Copies the selected text or object to the Windows clipboard, and then deletes it from Ad Hoc

Copy

Copies the selected text or object to the Windows clipboard

Paste

Pastes the contents of the Windows clipboard into the location specified by the user.  If pasting text, the text on the clipboard is inserted at the blinking cursor in an edit or text box control on a form.  If text is selected in the control, it is replaced by the contents of the clipboard.

Delete

Deletes selected text in a form edit box or text box control.


View Menu Command Summary

The View Menu contains commands that control the way some objects are viewed on the Ad Hoc desktop.  The common commands on the View Menu include:

Tables Window

Displays or closes the Tables Window.  When the Tables Window is open, this command is checked.

Report Edit View

Report Page View

Report Preview Mode

These commands appear when a report design window is active.  Use them to select one of the report window view modes.  See Report Design Window View Modes.


Options Menu Command Summary

The option commands display the Ad Hoc Options dialog, which enables you to set system options in the following categories:

Desktop Configuration Options,

Options for saving the  desktop when you exit Ad Hoc, and keystroke options for navigating lists.

Database Options

Database operation options.

Confirmation Options

Options for displaying confirmation messages before carrying out an operation, such as deletion of a record.

FastMenu Options

Configuration of the pop-up menu displayed by clicking the right mouse button when the cursor is over the Ad Hoc desktop.

Diagnostics Options

Options for the display of automatic diagnostics reports that check the design and data integrity of forms, lists, reports, and database tables.


Desktop Configuration Options

The Desktop Configuration dialog is displayed by selecting the Desktop Configuration command on the Options menu.  Use the Desktop Configuration dialog to set the way the Ad Hoc desktop is displayed when you start the program, and to select the method by which keystrokes help you to find a desired entry on a list.

Dialog Options

Open with last database

If this option is checked, Ad Hoc will remember which database is open when you exit the program, and will reopen this database the next time you start Ad Hoc.  If this option is not checked, Ad Hoc will not open a database automatically the next time you start it.

Save window size and position

If this option is checked, Ad Hoc will remember its main window size and position on the screen, and will appear with the same size and in the same position on the screen the next time you start Ad Hoc.  If this option is not checked, Ad Hoc will start with a default size and position for its main window.  You can re-size and move the Ad Hoc window after Ad Hoc starts.

Save Desktop

If this option is checked, Ad Hoc will save the desktop that is current when you close a database, and will re-display this desktop layout the next time you open that database.

No Keystroke Navigation

When you select this option, all forms of keystroke navigation on lists are turned off.  You can still move the highlight on the list with the up and down arrow keys, and the Home, End, PgUp, and PgDn keys.

Progressive Key Navigation

Select this option if you want to use progressive keystroke navigation on  all lists.

Single-key (Windows standard)

Select this option if you want Ad Hoc lists to work like standard list boxes that you find in dialogs in most Windows programs.

Reset Search with SPACE BAR

The SPACE BAR is normally used to reset a search key with the progressive keystroke navigation option.  Turn this option OFF (uncheck it) If you want to include spaces in your search string.  If this option is turned off, you can reset the search string by holding down the SHIFT key and typing the SPACE BAR.


Database Options

The Database Options dialog is displayed by selecting the Database Options command on the Options menu.  It enables you to set various operating options for the Ad Hoc database engine.

Dialog Options

Record Locking

When the record locking option is selected and  you make changes to a record on a form, Ad Hoc locks the record so another user, or another form, cannot update the same record until you are finished with it.  If you are editing a record on one form, record locking keeps you from making changes to the same record on another form until you have accepted the changes on the first form.

Note: If you run Ad Hoc in Windows enhanced mode, Ad Hoc loads and runs a program called VSHARE that enables record locking in Windows.  If you cannot run Windows in enhanced mode, you must enable record locking by running the DOS SHARE program before you start Windows. If you run Windows exclusively in 386 enhanced mode, you do not have to run the SHARE program.  If you are running both SHARE and VSHARE, VSHARE will temporarily disable and take over for SHARE while you are in Windows enhanced mode.

To run the DOS SHARE program, type the command share on the DOS command line before you start Windows, or include the share command in your AUTOEXEC.BAT file so that it is loaded whenever you boot DOS.  If you start Windows in your AUTOEXEC.BAT file, make sure the command to run share is before the command to run Windows.

Send Data Change Notices

Set this option if you want changes that you make in one form or list to be immediately displayed in all other open forms or lists.

With this option on, whenever a change is made to a record in a database table, either by editing a record on a form, or deleting or adding a record, or some other change to the database caused by a process running in the background, the change will be immediately reflected in all forms and lists open on the desktop, as well as in the Tables Window.

Note: A form or list is updated by a data change notice only if it was caused by a change in a field of the root table of the data view.

If this option is off, changes to data made on one form will not be displayed in other forms until you reload the changed record(s) into the form with a Next Record, Previous Record, etc. command.  It is recommended that you leave this option ON.


Confirmation Options

The Confirmation Options dialog is displayed by selecting the Confirmation Options command on the Options menu.  It enables you to select the operations that Ad Hoc will confirm with you before it carries them out.

Dialog Options

Updating a database record

Select this option if you want Ad Hoc to ask you to confirm changes that you have made to a record before those changes are put into the database.  Changes you have made to a record on a form are updated when you move to another record on the form, start a new record, or close the form.  If you don't select this option, the changes are updated automatically.

Deleting a database record

Select this option if you want Ad Hoc to confirm your request to delete a record on a form or list.

Rebuilding a table

When you request that a database table be rebuilt with the Rebuild Table command, Ad Hoc will ask you to confirm the operation if this option is set, otherwise it will immediately start the rebuild.

Redefining a table that has records

When you select the Edit Table Definition command for a table that has records in it, Ad Hoc notifies you that the table has records and it may have to be rebuilt if you make certain changes.  This notification will take place if this option is set.

Closing a database

Set this option if you want Ad Hoc to ask you to confirm the closing of a database whenever you use the Close Database command, or before closing the current database when you ask Ad Hoc to open a different database.

Require valid entries for form controls

When this option is set, Ad Hoc requires that the contents of a form control be valid before the input focus is moved to another control.  If this option is not set, Ad Hoc will warn you of invalid entries, but will let you move to other controls.  In either case, you cannot update the form if any control has an invalid value.


FastMenu Options

Select the FastMenu command on the Options menu to display this dialog.  The FastMenu Options dialog enables you to tailor a pop-up menu that appears whenever you click the right mouse button when the cursor is over the Ad Hoc desktop.  This menu  contains selections that make it easier to quickly open a form or print a report.  You can select any or all of the following to appear on this menu

Dialog Options

None

Check this option to un-check all the others.  With no options selected, the pop-up menu will not appear.

Open Dialog (Forms)

Check this option to place an Open Form command on the pop-up menu.  This command has the same action as the Open command on the File menu.

List of Recent Forms

Check this option if you want the pop-up menu to include the most recently opened forms or lists in the current database.  When you open a form or list, it is added to the top of the recent forms list.  When you select one of these entries when the pop-up is displayed, the corresponding form or list will be opened.  When you open a form this way, Ad Hoc will place the form on the desktop so that its upper left edge is a close as possible to the point where you pressed the right mouse button.  It will adjust this position to try to display all of the form or list.

Ad Hoc keeps track of the most recent forms opened for each database you have created.

Design Report Dialog

Check this option if you want the pop-up menu to include a Design Report command, which will have the same action as the Design Report  command on the File Menu.

Print Report Dialog

Check this option if you want the pop-up menu to include both a Print Report command, which will have the same action as the Print Report command on the File Menu, and a Display Report command, which will have the same action as the Display Report command on the File Menu.

List of Recent Reports

Check this option if you want the pop-up menu to include the most recently printed reports in the current database.  When you print, design, or display a report, it is added to the top of the list.  Selecting one of these entries when the pop-up is displayed will cause the corresponding report to be printed, displayed, or loaded into a Report Design Window.

Ad Hoc keeps track of the most recent reports for each database you have created.

Recent Report Options

If you select the "List of Recent Reports" option, you can further select what will be done to a report selected from the recent list.  The options you can select are

Print	to print the report

Display	to display the report output in a report display window

Design	to open a report design window for the report

If you select only one of these options, the corresponding action will appear before the report name on the FastMenu.  (for example "Print Employee Report").  If you select one or more of these options to appear on the FastMenu, a further level of menu will be appended to each recent report entry on the FastMenu, containing the options you select.

Maximum number of recent forms

If you have checked the recent forms options, this entry will determine the maximum number of recent forms that will appear on the pop-up menu.  You can select any number from 1 to 6 recent form menu entries.

Maximum number of recent reports

If you have checked the recent reports options, this entry will determine the maximum number of recent reports that will appear on the pop-up menu.  You can select any number from 1 to 6 recent report menu entries.


Diagnostics Options

See Also

Use Diagnostics Options to set the error severity level that will cause an automatic diagnostic test to display its results.  Whenever you open a form, list, report window, or database, Ad Hoc runs a diagnostics check on the integrity of the design.  If errors are found, Ad Hoc displays a window with the results of the diagnostics if the severity of problems exceeds a threshold that you set.  This lets you quickly tell if you have a conflict between a form design, for example, and the design of the database fields used on the form.  You can set the error threshold independently for forms (and lists), reports, and database tables.

Level	Diagnostics are displayed when

Fatal Errors	Only when fatal errors are detected

Errors	When fatal or other errors are detected

Warnings	Whenever any anomaly is found that may cause a problem

Always	Always, even if there are no errors

The pop-up menus on forms, lists, report design windows, and report output windows also contain a Run Diagnostics command, to allow you to check the design of an object at any time.


Diagnostics

Diagnostics command


Database Menu Command Summary

The Database Menu appears only when a database is open.  The most recently opened databases (up to four) appear at the bottom of this menu.  To open one of these databases, select its entry.

Open Database

Displays the Open Dialog to enable you to open a database.

Close

Closes the currently open database.

Create New Database

Enables you to create a new database.


Open Database Command  (Database Menu)

Use the Open Database command on the Database menu to change the database that you are working with.  When no database is currently open, this command appears on the File menu.

If there is a database already opened, Ad Hoc will ask if you want to close it.

Respond To
Yes	Close the currently open database and select a new one to open
No	To cancel the command
When you close the current database, all open desktop objects will be closed.  If the design of any of these objects has been changed, Ad Hoc will ask you if you want to save the design.  You have the same choice of response as for the Close command on the File menu.

If you proceed to open a database, Ad Hoc will display the Open File dialog, allowing you to select a data dictionary file that contains the description of the database you want to open.  A data dictionary file has the same name as the database ID, followed by a .DDF extension.  You can use the Open File dialog to navigate to the directory in which the desired database is located, then select its data dictionary file.  Ad Hoc will open the selected database and display its description in the title area of the Ad Hoc window.


Close Command (Database Menu)

Use the Close command on the Database menu to close the currently open database.  Ad Hoc will ask you to confirm that you want to close the database.

Respond To
Yes	Close the currently open database
No	To cancel the command
When you close the current database, all open desktop objects will be closed.  If the design of any of these objects has been changed, Ad Hoc will ask you if you want to save the design.  You have the same choice of response as for the Close command on the File menu.


Create New Database Command
Create New Database Command  (Database Menu and File Menu)

Use the Create New Database command to create a new database.  If a database is currently open, this command appears on the Database menu.  If no database is open, this command appears on the File menu.

If a database is open when you select this command, Ad Hoc will ask you if you want to close the current database.  If you answer NO, no action is taken.  If you answer YES, the current database is closed.

The New Database dialog is displayed, if you fill out this dialog and accept it by pressing ENTER or clicking OK, the new database is created.  If you cancel this dialog by pressing ESC or clicking Cancel, no database is created.

To create a new database, you must supply a unique ID for the database, a long description, and the pathname of a directory in which the database resides.  (See Creating a Database).

When the database is created, the system tables are created and the Tables Window is displayed. At this point you can begin defining tables for the new database.


Tables Menu Command Summary

The Tables Menu is associated with the Tables Window.  This menu is displayed whenever the Tables Window is the active window on the Ad Hoc desktop.  To open or close the Tables Window, select the Tables Window command on the View Menu.

New Table

Enables you to define a new table for the database.

Edit Table Definition

Enables you to change the definition of a table in the database.

Delete Table

Enables you to delete a table definition from the database.  This command optionally enables you to delete the file associated with the table definition.

Edit Database Information

Enables you to change the general design attributes of the database, such as its description.

Rebuild Table File

Enables you to rebuild a damaged database table file.  This command creates a new table file and copies records into it from the old table file.  If the copy is successful, the old file is deleted.  Otherwise, the new file is deleted and the old file remains unchanged.

Empty Table File

Removes all of the information stored in a table.  This command deletes the old table file and creates a new empty file for the table.

Update Tables Window

Updates the status information displayed in the tables window.

Display System Tables

Displays or hides the system tables in the Tables Window list.

Run Database Diagnostics

Runs a diagnostics test on the design of the database.

Run Table Diagnostics

Runs a diagnostics test on the design of the table selected in the Tables Window.


Update Tables Window Command
Update Tables Window Command  (Tables Menu)

Use this command to cause Ad Hoc to update the table status information displayed in the Tables Window.  If you suspect that the status of a table has changed since you opened the Tables Window, you can use this command to update the status display.

Ad Hoc will automatically update record counts for the tables as records are added or deleted from the database.


Display System Tables Command (Tables Window)

Use this command to display or hide the system tables in the Tables Window list, in addition to the tables you define.


New Table Command
New Table Command  (Tables Window)

See Also

Use the New Table command to add a new table definition to the database.  The Tables Window must be open before you can select this command.  The New Table Command displays the Database Table dialog, with which you design the attributes of a new table.  In order to add a new table, you must fill out this dialog, defining the fields of the table, and at least one index (the primary key).

To add a new table to the database

1.	Select the New Table command

2.	Describe the table and its fields, indexes, and links on the Database Table dialog.

3.	Click the OK button on the Database Table dialog, or press ENTER to accept the entries you have made

4.	Ad Hoc will create a new empty file for the table, and insert the table in the Tables Window list

Once you have added a new table definition to the database, you can design forms, lists, and reports using the table, and enter information into the table.


Design a new table


Edit Table Definition Command
Edit Table Definition Command  (Tables Menu)

See Also

Use the Edit Table Definition command to change the definition of a table in the database.  This command is available when the Tables Window is displayed, and when there are no other objects on the desktop, including forms, lists, and reports.  This commands enables you to examine or change the definition of the currently selected table in the Tables Window.  See Database Table Dialog for details on editing the table definition.

You can change the definition of a database table at any time, including adding, changing, and removing fields, indexes, and links to other tables.  But you must be careful of the following:

If table definition changes affect the design of a form, list, or report, make sure you also change these objects, or they will not operate properly.  Ad Hoc does not verify changes to a table definition against existing forms, lists, reports, or link definitions for other tables when you make changes to a table definition. However, when you open a form, list, or report, the diagnostics routines will usually catch errors caused by database changes.

For example, do not delete a field if there are forms, lists, or reports that use that field.

Do not change the primary key (the first index) if you have defined links in other tables that link them to this table.  If you must change the primary key, make sure you change the link definitions in the other tables.

If you change the file name or path name in the table definition, Ad Hoc may not be able to find the table file, unless you also rename (or move) the table file (using Windows File Manager).

Some changes that you make to a table definition require the table to be rebuilt.  Examples of these are adding, changing, or deleting fields from the tables, and changing the index definitions.  If you make these changes and accept them by clicking OK on the Database Table dialog, Ad Hoc will warn you that the table will have to be rebuilt and ask you if you want to proceed.  If you respond YES, Ad Hoc will proceed with rebuilding the table.  If you answer NO, you will return to the Database Table dialog.  At this point you can Cancel the changes, and no changes will be made to the table definition.

Some changes do not require the table to be rebuilt, and if you accept these changes by clicking OK or pressing ENTER, Ad Hoc will incorporate the changes into the data dictionary and update the status display in the Tables Window.

If Ad Hoc determines that a table must be rebuilt, and you allow it to proceed, a process window will open on the desktop, displaying the progress of the rebuild.  You can cancel the rebuild and discard the changes by clicking on Cancel in this window, or you can wait until the process is complete and click on OK (or press ENTER).  While a table is being rebuilt, you cannot open any other desktop objects (forms, lists, reports) or exit Ad Hoc.  You can edit or rebuild another table, however.


Delete Table Command
Delete Table Command  (Tables Menu)

Use the Delete Table command to delete a table from the database.  This command is available if the Tables Window is displayed and no forms, lists, or reports are open on the desktop.  This command deletes the table that is currently selected in the Tables Window.

If you select this command, Ad Hoc will ask you to confirm that you want to delete the table.  If you respond YES, the table definition will be deleted.  If a file is associated with the table, Ad Hoc will ask you if you also want to delete the file.

Warning: Once a table definition and the table file have been deleted, all data stored in the table will be lost.  You can only recover if you have backed up your database.  Use this command carefully.

Do not delete a table if it or any of its fields are referenced in a form, list, or report, or if it is referenced in a link defined in another table.  If you do delete the table, all references to it must be removed from these objects.  Ad Hoc does not check this for you when you delete the table, but will usually catch this problem when you use the form, list, or report.


Rebuild Table File Command
Rebuild Table File Command  (Tables Menu)

See Also

Use the Rebuild Table File command to rebuild the currently selected table in the Tables Window.  The command is available only when the Tables Window is displayed and no other desktop objects are open.

It is only necessary to rebuild a table file when the Table Window indicates that there is something wrong with the table: either there is no file, or the file is damaged and cannot be read normally.  To rebuild a table, select it in the Tables Window list and select the Rebuild Table File command.  Ad Hoc will ask you to confirm that you want to rebuild the table.

When the rebuilding begins, a process window is displayed on the desktop, showing the progress of the rebuild.  You can cancel the rebuild by clicking Cancel on this window.  When the rebuild is completed, click OK to close the progress window and complete the process.

While a table is being rebuilt, you cannot open other desktop objects or exit Ad Hoc.  You can rebuild several tables at once.

The rebuilding process creates a new temporary file and copies records from the old file into the new file, building the file indexes as the records are added.  If the process completes successfully, the old file is deleted, otherwise the new file is deleted and the old file remains the same.

Note:  If some of the records in the old file could not be written to the new, Ad Hoc will tell you and ask if you want to accept the rebuild anyway.  If you do, the unwritten records will be lost.  Accept a partial rebuild only after trying to rebuild the file at least twice and only if you have no backup of the table.  Use this as a last resort.


Database Maintenance


Empty Table File Command
Empty Table File Command  (Tables Menu)

See Also

Use the Empty Table File command to delete all the records from a table, or to create a new table file if one currently does not exist.  This command is available when the Tables Window is displayed.  It erases the table that is currently selected in the Tables Window list.  Ad Hoc will ask you to confirm the command before it erases the table.

Warning:  This command will erase all the data that was stored in the selected table.  The only way to recover the data is to restore it from a backup.


Edit Database Information Command
Edit Database Information Command  (Tables Menu)

Use the Edit Database Information command to edit attributes of the database.  Currently this is only the long description of the database.  You cannot change the ID of the database that was assigned when the database was created.  This command displays the Edit Database Information dialog.


Run Database Diagnostics
Run Database Diagnostics Command (Tables Menu)

Select the Run Database Diagnostics command when the Tables Window is displayed to run a diagnostics test on the design integrity of the database.  See Diagnostics for details.


Run Table Diagnostics
Run Table Diagnostics Command (Tables Menu)

Select the Run Table Diagnostics command when the Tables Window is displayed to run a diagnostics test on the design integrity of the table that is selected in the Tables Window.  See Diagnostics for details.


Window Menu Command Summary

Tile

Arranges all open desktop objects in a tiled layout.  If you select this command, Windows will move all the desktop objects and change the size of some objects.  Form objects will not change size, but lists, report designs, and the Tables Window will change size to fit the tiling pattern.

Cascade

Arranges all open desktop objects in a cascading layout.  If you select this command, Windows will move all the desktop objects and change the size of lists, report designs, and the Tables Window.  Forms will not change in size.

Arrange Icons

Arranges the icons of all desktop objects that have been minimized.

Close All

Closes all open desktop objects.  If the object design has been edited, Ad Hoc will prompt you to save the design.


Help Menu Command Summary

Contents

Displays the help system table of contents.

Search

Search for help on a topic in the help system index

Context

Display context sensitive help.  The help topic that appears depends upon the desktop object that is currently active.  This menu command gives the same results as pressing the F1 key.

Procedures

Display the Procedures help topic, which lists help topics on how to perform selected procedures in Ad Hoc.

Commands

Displays the menu commands reference in the help system.

Using Help

Displays help on using the help system.

About

Displays a dialog box with information about Ad Hoc.


Report Menu Command Summary

The Report Menu appears on the Ad Hoc menu bar when a report design window is the currently active desktop object.  This menu contains commands that allow you to design a report and test it.

Data View

Displays the Data View dialog, enabling you to design the database view that will be associated with the report.

Layout

Displays the Report Layout dialog, with which you can define the design attributes of the report.

Fonts

Displays the Fonts dialog, for specifying the fonts that will be used in the report.

Edit Startup Dialog

Displays the Startup Dialog associated with the report, and allows you to design it by placing controls on it that are associated with report fields.  This command is available only if you have designated that the report will have a startup dialog on the Report Layout dialog.

Elements

Displays a list of elements defined for the report, from which you can add new elements, edit the attributes of an element, or delete elements.

Regions

Displays a list of regions defined for the report, from which you can add new regions, edit the attributes of a region, or delete a region.

Insert Field

Inserts a database or other report field at the edit insertion point.

Options

Displays a dialog for setting report window options.  The options you can set depend on the view mode set for the report window.

Run Diagnostics

Runs a diagnostics test on the report.

Print

Prints the report being designed in the currently active report design window.


Elements Command
Elements Command  (Report Menu)

See Also

Use the Elements command to work with the elements that have been defined for a report.  The Elements command displays the Report Elements dialog.  From this dialog you can edit an element design, add new elements, or delete elements.


Designing Reports

Understanding Reports

Selecting Fonts for a Report

Designing Report Elements

Designing Report Regions

Designing a Report Startup Dialog


Regions Command
Regions Command  (Report Menu)

See Also

Use the Regions command to work with the regions that have been defined for a report.  The Regions Command displays the  Report Regions dialog.  From this dialog you can edit a region design, add new regions, or delete regions.


Layout Command
Layout Command  (Report Menu)

See Also

Use the Layout command to change the attributes of a report, including its description, page layout, font,  and other general report characteristics.  The Layout command displays the Report Layout dialog.


Fonts Command
Fonts Command  (Report Menu)

See Also

Use the Fonts command to specify the fonts that will appear on a report.  This command displays the Fonts dialog, which lists the fonts for the report and enables you to change the font for each element, or the default report font.


Edit Startup Dialog Command
Edit Startup Dialog Command  (Report Menu)

See Also

Use the Edit Startup Dialog command to design the report startup dialog.  This command is available if you have checked the "Startup Dialog" option on the Report Layout dialog.  This command displays the startup dialog in an edit mode, enabling you to design controls on the dialog.  See Designing a Report Startup Dialog.

Select OK on the startup dialog to accept design changes, or Cancel to discard them.


Data View Command
Data View Command  (Report Menu)

See Also

Use the Data View command on the Report menu to define the data view associated with the report.  This command displays the Data View dialog.  The data view of a report includes the fields from the database, additional fields, such as counters and computed fields that you have defined for the report, the sort specification, and the filter for database records.


Options Command  (Report Menu)

Displays the report window options dialog.  When the report design window is in Edit mode or Page mode, this command will display the Report Design Window Options dialog.  In Preview mode, this command displays the Report Display Window Options dialog.


Insert Field Command
Insert Field Command  (Report Menu)

Use the Insert Field command to insert a defined report field into the report layout at a designated location.  This command displays the Report Fields dialog.  This dialog lists the fields that have been defined for the report.  When you select a field from this dialog, it is inserted into the report layout at the cursor position.  You can also insert a field by pressing the INS key.

To insert a field in a report layout

1.	Move the edit cursor on the report layout to the spot you want to insert the field

2.	Select the Insert Field command (or press Ins) to display the Report Fields dialog

3.	Select the desired field from the Report Fields dialog by double-clicking it, or highlighting it and clicking OK or pressing ENTER.

To delete a field in a report layout

If the cursor is to the immediate left of the field, press the DEL key, or

If the cursor is to the immediate right of the key, press the backspace key, or

Select the field and press the DEL key

The types of report fields that can be inserted using the Insert Field command are:

Field Type Description
Pre-Defined Fields	Pre-defined report fields include Page, Date, and Time.
Database Fields	Fields from tables in the database.
Counter Fields	Counter fields are fields that accumulate running totals of database fields or counts of records printed in a report.
Computed Fields	Computed fields are fields that you assign a value to on the report startup dialog or are computed from other fields as the report is printed.


Print Command
Print Command  (Report Menu)

Use the Print command on the Report menu to test the report you are designing.  This command prints the report as it is currently appears in the report design window.


Form Menu Command Summary

The Form menu appears on the main menu bar whenever a form is the active window on the Ad Hoc desktop.  It contains commands that allow you to retrieve records from the database, control the updating of the record displayed in the form, and perform other run-time operations on the data associated with the form.

You can also display a fast menu that contains the most frequently used form commands  by clicking the right mouse button when the cursor is positioned over the free area of a form on the desktop, or by pressing Alt-M when a form is the active desktop object.  The "free area" of the form is any part of the form that is not a form control or a scroll region.

When a form is in design mode, the Form Menu displays a different set of commands, and is referred to as the Form Design menu.

The Form menu contains the following commands:

Find

Displays the search window for the form, which allows you to browse through the records in the view attached to the form and select a record to be loaded into the form.  This command is available only if the form has been designed with a search window.

Next

Loads the next record from the view into the form.

Previous

Loads the previous record from the view into the form.

First

Loads the first record from the view into the form.

Last

Loads the last record from the view into the form.

Filter

Displays the Filter Rules dialog so that you can change the record selection filter of the form while you are using it.  The filter you set this way is not stored permanently with the form design unless you subsequently save it.

AutoDuplication Options

On the form fast menu in run mode.  Sets the forms autoduplication options for adding new records.

New

Blanks out the data displayed on the form and prepares for the entry of a new record into the database.  This command is only available if the form has been designed to add new records.

Update

Updates the displayed record in the database if changes have been made.  This command is available only if the form has been designed to allow changes to data, and you have changed one or more of the fields on the form.

Cancel

Cancels changes to the data on the form, restoring all fields to their original value.

Delete

Deletes the current record displayed on the form.  If you select this command and the confirmation option is turned on, Ad Hoc will ask you if you want to delete the record.  Respond Yes to delete it, No to avoid deleting the record.  This command is available only if the form has been designed to allow deletion of records.

Print Record

When a report is attached to a form, this command adds the record current displayed to the report output.  See Attaching a Report to a Form or List.

New Page

When a report is attached to a form, this command causes the report to perform a page break, starting a new page for the report.

Attach Report

Use this command to select a report from the Reports table to attach to the current form.  The report must be based on the same root table as the form.

Design Attached Report

Use this command to open a report design window to edit the design of the report attached to the form.

Close Report

Use this command to close the report attached to the form and release the printer.

Import

Initiates a data import using the data exchange template attached to the form.  This command is only available if the form has been designed with a data exchange template.

Export

Initiates a data export using the data exchange template attached to the form.  This command is only available if the form has been designed with a data exchange template.

Form Links

Links the active form to another form or list on the desktop.  The active form becomes a master to the linked form or list, controlling the data that is displayed in it.

Run Diagnostics

Runs a diagnostics test on the form design.

Design Mode

Places the form in design mode, allowing you to make changes to the design of the form.  In design mode, you can display records from the database on the form, but you cannot add, edit, or delete records.


Import Command
Import Command (Form Menu)

See Also

Use the Import command to import data from an external file into a Ad Hoc database.  Data is imported through a form for which a data exchange template has been defined.  The Import command displays the Data Import dialog, which enables you to control the import process.


Data Exchange Template Dialog

Importing Data

Exporting Data


Export Command
Export Command  (Form Menu)

See Also

Use the Export command to export data from a Ad Hoc database to an external file.  Data is exported through a form for which a data exchange template has been defined.  The Export command displays the Data Export dialog, which enables you to control the export process.


Design Mode Command
Design Mode Command  (Form Menu and List Menu)

Use the Design Mode command to put a form or list in design mode.  This command appears on the Form menu and on the List menu.

When a form or list is in design mode, you can make changes to its design by using commands on the Form Design menu or List Design menu, respectively.


Form Design Menu Command
Form Design Menu Command Summary

The Form Design menu appears on the main Ad Hoc menu bar when the active form is in design mode.  This menu contains commands that you use to design the form layout and other characteristics including fonts, colors, and database permissions .

You can also display a fast menu that contains the most frequent form design commands by clicking the right mouse button when the cursor is positioned over the free area of the form, or by pressing Alt-M when a form is the active desktop object.  The "free area" of the form is any part of the form that is not an item such as an edit control or scrolling region.

The following commands are on the Form Design menu:

Undo

Use this command to undo the last change made to the form.

Form Attributes

Use this command to display the Form Attributes dialog.  You use this dialog to define the Form ID, the form description, and set custom attributes of the form.

Data View

Use this command to display the Data View dialog.  You use this dialog to define the fields from the database that are used on the form, as well as the sort order and selection filter of the view.

Fonts

Displays the form Fonts dialog, where you can specify the fonts to be used to display control titles and data on the form.

Colors

Displays the form Colors dialog, where you can specify the colors to be used to display the form.

New Control Commands

The following commands are used to insert new controls on a form.  When you select the command, Ad Hoc will display the attribute dialog for the selected control type.  When you accept the entries on the dialog, the mouse cursor changes to a cross.  Position the cursor at the spot on the form where you wish the upper left corner of the control to be located, and click the left mouse button.

New Edit Box

Use this command to insert a new edit box.  See Edit Box Attributes Dialog.

New Combo Box

Use this command to insert a new combo box control.  See Combo Box Attributes Dialog.

New Text Box

Use this command to insert a new text box control.  See Text Box Attributes Dialog.

New Check Box

Use this command to insert a new check box control.  See Check Box Attributes Dialog.

New Frame

Use this command to insert a new frame  control.  See Frame Attributes Dialog.

New Button

Use this command to insert a new button  control.  See Button Attributes Dialog.

New Scroll Region

Use this command to insert a scroll region on the form. Ad Hoc will display two dialogs in succession to allow you to define the scroll region before it is displayed:  the List Attributes dialog allows you to define the design attributes of the list attached to the scroll region, and the Data View dialog allows you to define the database view associated with the list.

When you have entered the design information in these two dialogs, Ad Hoc displays an imbedded list form in the scroll region.

Set Tab Order

Enables you to set the tabbing order of the controls on the form.  This is the order in which the controls will receive the input focus when you press the Tab key.  When you select this command, the cursor changes to the Tab Order shape.  Move the cursor to the first control in the tabbing order, and press the left mouse button.  The control will be highlighted.  Continue clicking on the controls in the order that you want.  When the last control is highlighted, the cursor will change back to its regular appearance, indicating that all the controls have been ordered.  You can exit the tab order mode at any time by selecting the Set Tab Order command again.  The controls that you order before exiting stay in the new tab order.

Quick Layout

Enables you to quickly lay out the controls of a new form.  When you select this command, Ad Hoc displays the Quick Form Layout dialog, where you can define the layout of controls on the form.  When you accept the entries on the dialog, Ad Hoc adds the controls you specified to the form.  You can perform a quick layout only on a form that contains no controls.

Data Exchange Template

Use this command to display the DX Template dialog.  You use this dialog to define the characteristics of the data exchange template attached to the form.  This command is accessible only if you have checked the Data Exchange Template check box on the Form Attributes dialog.

Run Diagnostics

Runs a diagnostics test on the form design.

Leave Design Mode

Takes the form out of design mode.  The form then can be used to add, edit, and delete records in the database.


Form Control Design Menu
Form Control Design Menu Command Summary

The Form Control Design menu contains commands that you will use to edit, align and size the controls on a form.  To display this menu, click the right mouse button within the selection boundary of a control.  The commands that appear on the menu will depend on whether one control or several controls are currently selected.  When several controls are selected, the command is applied to all controls.

Edit Control Attributes

Displays the attributes dialog for the selected control or controls.  You use this dialog to define the characteristics of a form control, such as the field it is associated with, its title, the position of the title, and its display style.  If more than one control is selected, the attributes dialog for each control will be displayed in sequence.

Design Lookup Window

This command appears only if a single control is selected.  If the selected control has a lookup window, this command displays the controls lookup window so that you can edit its design.  See Designing Lookup Windows.

Align Horizontally
Left Sides
Right Sides
Centers
Space Equally

Use these command to align a group of selected controls in the horizontal direction.  Controls are aligned along the edges on the data entry areas,  not the titles.  See Aligning Controls on a Form.

Align Vertically
Tops
Bottoms
Centers
Space Equally

Use these command to align a group of selected controls in the vertical direction. See Aligning Controls on a Form.

Change Width
Grow to Largest
Shrink to Smallest

Use these commands to make all the selected controls the same width.  In sizing controls, the titles are ignored.  See Sizing Controls.

Change Height
Grow to Largest
Shrink to Smallest

Use these commands to make all the selected controls the same height.  In sizing controls, the titles are ignored.  See Sizing Controls.

Center in Form
Horizontally
Vertically
Both

Use one of these commands to center the selected control or the group of selected controls within the boundary of the form, either horizontally, vertically, or both.  The smallest rectangle that encloses the selection boundaries of all the selected controls is centered.

Default Height
Default Width

These commands appear only when a single control is selected.  They can be used to reset the control to a default width or height based on the control style and the font.  A new control has this default size when it is first placed on the form.

Delete Control (single control selected)
Delete Selected Controls

Use this command to remove all the selected controls from the form.


List Menu Command Summary

The List menu contains commands that allow you to perform operations on the data associated with the list.

The List menu appears on the main menu bar when a list is the active desktop object.  You can also display a fast menu that contains the most frequent list commands by clicking the right mouse button when the cursor is positioned over the list, or by pressing Alt-M when a list is the active desktop object.  When the list is in design mode, the commands on the List Menu change to design functions.

The List menu may contains the following commands, depending on the permissions you assigned when you designed the list:

Add Record

Enables you to add a record to the database through the pop-up edit form associated with the list.  This command is not available if the list has not been designed to add records to the database.

Edit Record

Enables you to edit the record associated with the highlighted entry in the list.  The editing is done on the pop-up edit form associated with the list.  This command is not available if the list has not been designed to edit records.

Delete Record

Deletes the record associated with the highlighted entry in the list.  When you select this command Ad Hoc will ask you to confirm the deletion if you have the confirmation option set.  This command is not available if the list has not been designed to add records to the database.

Filter

Displays the Filter Rules dialog so that you can change the record selection filter of the list while you are using it.  The filter you set this way is not stored permanently with the list design unless you subsequently save it.

Form Links

Links the form to another form or list on the desktop.  The active form becomes a master to the linked form or list, controlling the data that is displayed in it.

Print Record

When a report is attached to a list, this command adds the entry currently selected on the list to the report output.  See Attaching a Report to a Form or List.

New Page

When a report is attached to a list, this command causes the report to perform a page break, starting a new page for the report.

Attach Report

Use this command to select a report from the Reports table to attach to the current list.  The report must be based on the same root table as the list.

Design Attached Report

Use this command to open a report design window to edit the design of the report attached to the list.

Close Report

Use this command to close (end) the report attached to the list and release the printer.

Run Diagnostics

Runs a diagnostics test on the list design.

Design Mode

Places the list in design mode, so that you can change the design attributes and database permissions of the list.


List Design Menu Command Summary

The List Design menu appears on the main menu bar when a list in design mode is the active desktop object.  It contains commands that you will use to design a list.  With these commands you can design the database view associated with the list, define the columns that will be displayed on the list, and design other characteristics of the list.

You can also display a fast menu that contains the most frequent list commands by clicking the right mouse button when the cursor is positioned over the list object on the desktop, or by pressing Alt-M when a list is the active desktop object.

The following commands are on the List Design menu:

List Attributes

Displays the List Attributes dialog, which enables you to define the basic design attributes of the list.

Data View

Displays the Data  View dialog.  You use this dialog to define the database view associated with the list, the fields of the database view, its sort order and selection filter.

Columns

Displays the List Column Fields dialog, which enables you to designate the fields that make up the columns of the list, and to edit the column headings.

Fonts

Enables you to specify the fonts to be used for the column headings and entries in the list.

Colors

Enables you to specify the colors of the various areas of the list.

Control Style

This command appears only for lists that are embedded in a scroll region on a form.  It enables you to specify the title of the scroll region on the form.

Link to Parent

This command appears only for lists that are embedded in a scroll region on a form.  It enables you to define the form link between the list and the form it is embedded in.

Use this command to display the Edit Link dialog, which you use to define the link between the list and the form you have placed it on.

Run Diagnostics

Runs a diagnostics test on the form design.

Leave Design Mode

Takes the list out of design mode.


Report Display Window Menu Command Summary

You display the Report Display Window menu by clicking the right mouse button when the cursor is over the display area of a report display window.  The following commands are on the menu:

Select Report

Select this command to open the Print Report dialog, from which you can select a report to be displayed in the window.

Restart Report

Select this command to generate the current report again after you have changed display options or changed the design of the report.  While a report is being generated, this command becomes "Stop Report" and selecting it will stop the report generation.

Options

Select this command to display the Report Display Window Options dialog, which enables you to view and change the report display window options.

Go To Page

Select this command to type in the number of the report page that you want to display.

Next Page

Select this command to display the next page of the report.

Previous Page

Select this command to display the previous page of the report.

First Page

Select this command to display the first page of the report.

Last Page

Select this command to display the last page of the report, or, if the report is still being generated, the last generated page.

Run Diagnostics

Runs a diagnostics test on the design of the currently loaded report.


Run Diagnostics Command

This command appears on several menus associated with forms, lists, and reports.  Select this command to runs a diagnostics test on the form, list, or report.  See Diagnostics for details.


Autoduplication Options

When you are adding new records on a form, you can set options for copying the values of fields from the previous record into the fields of a new record.  When the first new record is added, the field values of the currently displayed record (before you click the New Record icon) are copied into the new record.  You then change the fields you want for the new record and insert the record.  On successive adds, the final values of the previous record are copied to the new record.

You can set the autoduplication options on the forms fast menu when the form is in run mode.  When a form is first opened, the default option (Autoduplication Off) is set.  The option you select is in effect until the form is closed.

Option	Action when a new record is started

Off	All the fields are blanked (the default setting)

Duplicate Only Allowed Fields	Only fields that are part of no-duplicate allowed indexes (such as the primary key field) are blanked, all others are duplicated from the previous record.

Duplicate All	All field values are duplicated from the previous record, you must change all fields that are part of no-duplicate indexes before the new record is accepted in the database.  Use this option if it is easier to type in modifications to the non-duplicate fields (usually just the primary key) than it is to enter a new value from scratch.

Autoadd feature

Setting any of the autoduplication options except off also sets the Autoadd feature.  When you fill out a new record and insert it by pressing Return or clicking the Update [image] icon, another new record is automatically started.  Insert as many new records as you want, then select Cancel Record Update (press ESC or click the Cancel [image] icon) to terminate the Autoadd feature.  To turn off Autoadd, turn off Autoduplication.

Even with Autoduplication off, you can add consecutive records by filling out a new record then clicking the New Record [image] icon to insert the current record and start a new one in one step.


Glossary

A

active form

active window

B

break level

break, report

break event

Btrieve

Btrieve file

button

C

check box

combo box

computed field (report)

control

control pad

control selection boundary

counter field

D

database

data change notice

data dictionary

data exchange

data exchange template

data types

data view

design mode

desktop

desktop layout

desktop object

E

edit box

element, report

embedded list

envelope report

envelope report style

event, report

export

extended field ID

extension, filename

F

fast menu

field

file

file, system

file, table

filename

filter

filter rule

FIM

floating region

focus

font

foreign key

form

form control

form links

frame

I

ID

import

index

index segment

input focus

K

keystroke navigation

L

label report

label report style

landscape orientation

link

list

M

margins, report

maximize icon

minimize icon

N

next record event

null

P

pathname

permission

page break

page footer

page header

point

portrait orientation

POSTNET code

primary key

primary key index

primary table

R

record

record locking

region, report

render

report

report break

report dialog

report field

report style

required field

ruler

S

scroll bar

scroll region

segment

sort specification

startup dialog, report

status bar

system files

system menu

T

table

table file

table link

text box

title bar

V

view


The active form is the form or list on the desktop that is currently accepting keyboard input.  It is also on top of any other forms displayed on the desktop.  The active form has a highlighted title area as an indicator.  To make a form the active form, you can click on it with the left mouse button, or select it from the Window menu.


The active window is any window whether its a main program window, a desktop object (form, list, etc., a dialog, or other pop-up window that currently has the input focus.  The window with the input focus is the window that receives and responds to keystrokes.  Usually the title bar of the active window is highlighted.


A report break, or break level is a division in a report that occurs when a designated field in the report changes value.  Breaks are defined by the fields that are used to sort a report.  A report break event can be used to print a group heading or total line in a report.

a break header event happens before the first record of an new group is printed

a break footer event happens after the last record of a group is printed


A report field is an item of data that is associated with a report.  It can either appear on the report layout or be used to control the report sort order or record selection.  There are several types of report fields:

Database fields, the fields defined in the report data view, are used to include data from the database in the report

Built-in fields, such as Date and Page Number

Counter fields are special fields that are used to accumulate running totals or averages

Computed fields are fields whose values are computed or input by the user when the report is printed.


Btrieve is a record manager from Novell.  Ad Hoc uses Btrieve as the default physical file format for its database tables.


A Btrieve file is a DOS file that can be read or written by Btrieve.  The database system tables and the default file type for Ad Hoc database tables are Btrieve files.


A button control on a form functions just like a button on a regular Windows dialog.  You click the left mouse button on the form button to send a command to the form.


A check box control on a form functions just like a check box on a regular Windows dialog.  Check box controls can be used for fields that are defined with the Set validation type.


A combo box is a control, or data entry area, on a form or dialog box that gives you the option of entering a value, or selecting a value from a list.  Some combo boxes allow you only to select a value from a list.  If the list is not displayed, an arrow icon is shown on the right of the data area, click on this icon to display the list, then select an entry.


A computed field in a report is a field whose value is computed from other fields, from a constant expression defined when the report was defined, or is input by the user on the startup dialog before the report is printed.


A form control is an object on a form that displays and enables you to edit the contents of a data field.  Control types include edit boxes, combo boxes, text boxes, and check boxes.


A counter field in a report is a report field that accumulates a running total of the value in a designated target field in the report view as records are printed in the report.  A counter field can compute a total, count, average, minimum, or maximum of the target field values.


A control pad is a set of icons in a window or form that represent actions you can initiate.  To initiate an action, click on the icon.  Clicking on a control pad icon has the same result as selecting a command from a menu.


The selection boundary of a control on a form is the rectangle that encloses both the control proper and its title.  In design mode, clicking the mouse within the selection boundary selects the control.  You can drag the selection boundary to change the size of the control.


Database

A database is a collection of data organized in ways that make it possible to enter and retrieve the data in many different ways.  The basic structural unit of a database is a table.  The descriptions of how data is organized in the tables, and how the information in one table relates to information in another table is stored in the data dictionary of the database.  A database also contains formats for data entry forms, browse lists, and reports.


A data change notice (or database change notification) is sent to all open forms and lists, as well as the Tables Window, whenever an operation makes a change in the database, such as adding, deleting, or editing a record.  This allows a form or list displaying data to update its display if it is affected by the change.  You can turn this feature off on the Database Options dialog.


Data Dictionary

A data dictionary is a description of how the data in a database is organized, and where the information is stored on disk.  It describes the tables, fields, and indexes of the database.  It also describes how information in different tables can be linked together.


Data Exchange is the process of importing data into a database or exporting data out of a database.


A data exchange template defines a data import or export process.  It describes the fields that will be imported or exported as well as the type of file the data will be read from or export to.  A data exchange template can be associated with a form, so that you can import or export data through the form.


A data view, or view,  is a collection of fields from one or more tables in a database.  It acts like a table in that it can be sorted and filtered, and you can retrieve records from it (and update records in it).  Ad Hoc forms, lists, and reports are associated with a view.


You can set design mode for a form or list object on the desktop by selecting the Design Mode command on the form or list pop-up menu (press the right mouse button when the mouse cursor is over the form or list).  When an object is in design mode, you can change its design and layout, then save it with the Save command on the File menu.


The desktop is the main area of the Ad Hoc window.  Forms, lists, report edit windows, and other objects appear on the desktop.


A desktop layout is a snapshot of all the forms and lists open on the desktop, including their size and position and any form links between them.  You can save a desktop layout under a specified name so that you can restore it again at a later time.


A desktop object is a window that appears on the Ad Hoc desktop.  Desktop objects that you can display on the desktop include forms, lists, report design windows and report display windows.  The Tables Window is also a desktop object.  Other desktop objects include the process windows that appear when you initiate a process, such as rebuilding a table or importing data.


An edit box is a object on a form that displays the value of a data field.  If the edit box is not set to display only, you can edit the field contents in the edit box.


An embedded list is located in a scroll region on a form.  A embedded list is usually linked to its parent form so that it displays records related to the record displayed on the form.


An envelope report is a specialized report for printing envelopes.  You can design and save envelope styles (envelope size and address layout) and attach different styles to the same envelope report.


An envelope report style defines the size of an envelope, the layout of the addresses on the envelope, and the location of POSTNET bar codes and FIM stripes on the envelope.  Envelope styles can be saved in the Styles table and attached to different envelope reports.


A filename extension is the suffix at then end of a filename, separated from the main part of the filename (the title) by a ".".  Extensions are usually used to designate the type or use of a file.  The extensions used in Ad Hoc are:

.DDF	the data dictionary file of a database

.DD	a database system file

.DBF	a database table file

.FRM	a form or list design (template)

.RPT	a report design (template)


A report event is an action that takes place during the printing of a report.  Examples are the start of the report, the start of a new page, reading of a new record from the report view, etc.  Events can trigger the printing of parts of a report, such as a page header.


Export is the action of sending data from a Ad Hoc database to an external file or database .


An Extended Field ID is used to identify fields in a data view, which may contain fields from several tables.  If a field comes from the view's primary table, its extended ID is the same as its ID in the table.  If a field comes from a linked table, its extended ID also contains the IDs of the link (or links) from the primary table to the linked table.


A report element is a object that appears on a report.  An element can be a detail line, a report title, a paragraph or several paragraphs, etc.  An element is printed in a specified region (area) of the report when a specified event occurs (such as a new page is started, or a new record is read from the view).


A fast menu is a menu that you can display by clicking the right mouse button when the mouse pointer is over a particular window or object.  The commands on a fast menu apply specifically to the object you clicked.


Field

A field is a data item of a particular type, such as text, numbers, dates, etc.   When you define a table in a database, you define a list of the fields that will be contained in the records of the table.  Besides the type of data the field will contains, you can also designate the size of the field (the number of characters a character field will contain, for example), instructions on how data is entered into the field, and (optionally) rules to validate the contents of the field.


The term file in Ad Hoc means a DOS file on your hard disk or a diskette.  A database table is stored as a file.  Therefore, a table not only has an ID, by which it is identified in the data dictionary, but it also has a DOS file name.


A filename is the name used by DOS to identify a file.  It includes the file title, which can be up to eight characters, followed optionally by a period and an extension, which can be up to three characters.  Each database table must be given a file name for it to be stored on the disk.


A filter  determines the selection of records from a table or view when the records are displayed in a form or printed in a report.  A filter is a set of filter rules or selection criteria, such as "ORDERNO equals 334 and DATE greater than 3/4/93".  Only records in the table whose ORDERNO field equals 334 and DATE field is later than 3/4/93 are selected.


A filter rule is a record selection rule.  A set of filter rules make up a filter.  A rule is usually composed of the ID of a field in a record, an comparison operator such as "equals" or "greater than", and a value to which the contents of the field is compared.


An FIM is another type of postal bar code used for automated mail processing.  Ad Hoc prints the FIM A pattern, used for Courtesy Reply mail.  The FIM A code can be used only if there is also a POSTNET code on the envelope.  The FIM code is printed in the required position to the left of the stamp area.


a floating region is a report region that doesn't have a fixed vertical position or size, but "floats" or extends between the regions above and below it.


A font is a collection of type faces and styles that you can apply to text in forms, lists, and reports.  When you specify a font, you specify the type face, size, and style (e.g. bold or italic) of the text.  Your font selection is limited to the fonts you have installed in Windows and (for reports) the fonts available for your printer.


A foreign key is a field, or group of fields, in a database table record, that together are equivalent to the primary key of another table.  Foreign keys are used to defined link, or relations between two tables.


A form is a window on the Ad Hoc desktop that is used for entering and editing data in the database.  A form displays one record at a time from the database and appears much like a standard Windows dialog.  You can design forms and store them in the database for later use.


Form Link

A form link used to link a form or list to another form or list on the desktop.  When a form is linked to another form, it becomes a "slave" to the other form, and the records it can display are determined by the record that is currently selected in the other form.


A frame is a form control that can be used to place a box around a group of other controls on a form, place a horizontal or vertical line on a form, or display text on a form without a frame.


ID

Every object defined in a database requires a unique identifier for the program to be able to locate it and work with it.  When you design a database, you specify an ID for the database, and for each table, field, table link, form, list, and report.  The ID is only 8 characters to save space, so these objects also have a longer Description that serves as a name you can recognize.  No two objects of the same type can have the same ID, except that fields in different tables can have the same ID.


Import is the action of reading data from an external file or database into a Ad Hoc database.


An index is a permanent sort on a database table that is stored with the table.  The data dictionary can contain a number of indexes for a particular table.  As records are added or deleted to a table, the index is updated to remain current.


An index segment is one of the fields that define an index in a table.


The input focus is a term in Windows describing which window on the screen is currently active and receiving input from the keyboard.  On a dialog, or on an Ad Hoc form, the control with the focus is the one that you are currently entering data into.  You move the focus by pressing the TAB or Shift-TAB key, or by clicking on another control.


Keystroke Navigation

Keystroke navigation is the process of selecting an entry in a list by typing characters instead of using the scroll arrows.  Ad Hoc has two options for keystroke navigation: progressive keystroke navigation, the default option. allows you to type a string of characters that is used as a search key for an entry in the list.  As you enter each character, the highlight is moved to a new entry that is the closest match to the entire string.  The second option is a single-key option, typing a character moves the highlight to the next list entry that starts with that character.


A label report is a specialized report for printing labels (mailing labels, shipping labels, name tags, etc.).  You can design and save label styles (label size and page layout) and attach different styles to the same label report.


A label report style defines the size of and page layout of labels (mailing labels, shipping labels, name tags, etc.).  Label styles can be saved in the Styles table and attached to different label reports.  Ad Hoc also has a number of standard label styles listed by Avery product number.


Landscape orientation for a printer is when the long dimension of the paper is at the top


Link

There are two types of links in Ad Hoc.

A table link is an association, or relation, of two tables.

A form link is a control link between two forms on the desktop.


A list is a desktop object that can display a number of records from the database at a time in a scrolling row-and-column format  You can design lists and save them in the database for later use.


Report margins are the margins set in the report layout for a printed page.  You set left, right, top and bottom margins for the page layout of a report.


  The maximize icon on a window enables you to re-size the window to its maximum size.


  The minimize icon on a window enables you to re-size the window to an icon.  If you minimize Ad Hoc, it will appear as an icon on the Windows Desktop.  If you minimize a form, list, or other Ad Hoc desktop object, it will appear as an icon on the Ad Hoc desktop.  Double-click an icon to restore the window to its previous size.


A next record event is a report event that is signaled each time a new record is read from the report view.  Elements containing information for each record are attached to next record events.


A null value for a field is a value that has not yet been defined.  If you do not enter a value for a field when you fill out a form, the value of the field is null, and the field will be blank.  Note that for a numerical field, a null value is not the same as a value of zero.


A pathname is the name of a DOS file prefixed by its location on the disk.  For example, a file with the filename TEST.DBF that is located in a directory called DATA located in the root directory of the C: drive would have the pathname "C:\DATA\TEST.DBF".

When you define a database table in Ad Hoc, there is an entry for the filename and a separate entry for the pathname.  The pathname entry in this case should not include the filename.  For the above example, the pathname would be entered as "C:\DATA".


A database permission allows a form or view access to change a record in the database.  Permissions include:

Add a new record

Change the contents of a record

Delete a record


A page break is the action of starting a new page when a report is printing.  A page break generates two report events:

a page header event is the first event generated when a new page is started

a page footer event is the last event generated before the report sends a form feed to the printer to start a new page


A point is a typographical unit of measure.  There are 72 points in an inch.  A point is used to measure the height of characters in a font or the leading (spacing between lines).


Portrait orientation of a printer is when the short dimension of the paper is at the top of the page.


The POSTNET code is a special bar code used by the U.S. Postal Service to encode zip codes.  On envelope reports, it is positioned above the delivery address.


The primary key of a database table is a field, or group of fields, whose value uniquely identify a record in the table.  Therefore no two records can have the same value for the primary key.  Every table has an index based on the primary key, and the primary key index is always the first index defined for the table.


The primary key index of a table is the first index, or index 0, in the table's index list.  It sorts the table by its primary key.  This index should be defined without the Modifiable, Duplicates Allowed, and Nulls Allowed attributes.


Record

A record is the unit of storage in a table that represents all the information for a particular person or object.  In the row and column representation of a database table, the rows in the table correspond to records.  A record is divided into the fields, or data categories, defined for the table.


When the record locking option is on, and an application locks a record, no other application can access the record until the locking application releases it.  When you make a change to a form, the form locks the record until you update the record.


A report region is a specified area on the page layout of a report, where designated elements of the report are rendered.


A required field is a field that has the Non-null values required attribute, meaning the that field is not allowed to have a null value.  Each record in a table must contain a value for a required field.  When you are entering a new record through a form, you cannot leave a required field blank.


Rendering is the act of printing an object in a report, or displaying an object on the screen.


A report is designed output format for data that can be printed or displayed on the screen.  A report design is stored in the database and retrieved when a report is printed.


A report dialog is a specialized dialog that you can include in the design of the report.  The report dialog is displayed just before the report is printed to allow the user to set report parameters and change printer settings.


A report style defines the page layout for special types of reports.  A report style can be stored in the _STYLES table and attached to several different reports.  Ad Hoc has styles for label and envelope reports.  The Styles table is located in the Ad Hoc program directory, and is automatically defined in the data dictionary of every Ad Hoc database.


The primary table, or root table of a view is the database table upon which the view is based.  The indexes of the primary table are also the indexes of the view.  When you read records from the view using an index (instead of sorting the view), the records are in the order of the corresponding records of the primary table.  A view must have a primary table defined, and the fields of the view will be fields from the primary table as well as fields from other tables related to the primary table by table links.


Report Design Ruler

The ruler displayed at the top of the Report Design Window indicates the horizontal position within the margins of the report in inches.  The bottom half of the ruler contains margin and tab indicators.


A scroll bar is a window control that enables you to use the mouse to make the list scroll.


A scroll region is an area on a form that contains an imbedded list object.  You can manipulate a scroll region when the form is in design mode just as you would other form controls.


A segment is a data field that is part of an index, primary key, or foreign key.  For example, the primary key of a table might be composed of two of the fields defined for the table.  Each of those fields is a segment of the primary key.  An index for the table based on the primary key would have the same two segments.  A foreign key for this table in the record of another table would also have the same two segments.


A sort specification is a description of how the records in a data view will be sorted.  It is a list of the fields from the view whose values will be used to sort records.  Each field can be sorted in ascending or descending order.


A report startup dialog is displayed before a report is printed, to enable the user to specify certain values or report controls to be used during the printing of the report.


The status bar is displayed at the bottom of the Ad Hoc main window.  It shows the status of operations and also quick help when selecting commands from menus.


The system files of a database include the data dictionary file, which defines the database and its tables, and other files that store additional information, such as form and report designs.  The names of these files (except for Styles) are based on the ID of the database.  For a database with ID MYDB, the system files are:

MYDB.DDF	the data dictionary file

MYDBD.DD	the _DDDATA table file.  Contains data dictionary information such as field validation rules

MYDBF.DD	the _FORMS table file.  Contains forms, lists, and saved desktop layouts

MYDBR.DD	the _REPORTS table.  Contains report designs

STYLES.DBF	the _STYLES table.  Contains report styles.  The file is located in the Ad Hoc program directory and is defined in the data dictionary of all databases.


The system menu of a window is a standard menu that controls the sizing and display of the window.  The system menu is displayed when you click on the system menu icon (or click on the window icon if the window is minimized).

  The system menu icon is located in the upper left corner of a window.  Double clicking on the system menu icon will close a window.


Table

The data in a database is stored in a basic unit called a table.  The data in a table usually relates to a specific category of objects, such as employees or purchase orders.  You can picture the arrangement of data in a table in a row and column format.  The rows are called records and relate to a specific object, such as an employee.  The columns correspond to the data items, or fields, contained in the table, such as employee ID and name.  You can define indexes for a table, which make it possible to retrieve the records in a particular order.  In Ad Hoc, you can also define relationships to other tables, called links.


A database table file is the physical file on disk associated with a database table.  The name of the file is specified in the table definition on the Database Table Dialog.  The suggested name of a table file is the ID of the table followed by the extension ".DBF".


Table Link

A table link relates information in one table to information in another table.  If a database consists of more than one table, it is usually desirable to retrieve information from more than one table to use in a report or screen display.  Relational databases provide ways for you to "relate" the fields from one table to the fields from another table.  Using the sample employee database that is provided with Ad Hoc as an example, you may want to print an employee report with information from the employee table and also information about the department each employee works in from the department table.  There must be a way to connect each employee record in the EMPLOYEE table with the appropriate department record in the DEPT table.  The link between the two tables is defined as:  the DEPT field (employee's department) in the EMPLOYEE table matches (equals) the DEPTID field (department id) in the DEPT table.


A text box is a form control that is used to display and edit a field of type Text.  The text box contains multiple lines of text that can scroll vertically.


The title bar is the area at the top of a window, including the Ad Hoc main window and the desktop objects, that contains the title of the window.  If the window is active, the title bar will be displayed with the highlighted color.  You can move a window by dragging its title bar.


Printing and Displaying Reports
Printing and Viewing Reports

Up

Set up a printer

Print a report

View a report

View a report in preview mode

Zoom the report view

Set report display options

Print mailing labels

Print envelopes


Set up a printer

Select the Printer Setup command on the File menu

Highlight a printer in the list on the Printer Setup dialog

Click the Setup button to display the setup dialog for your printer

The setup dialog is specific to your printer.  Click the Help button on the dialog for help.

Select OK on the Printer Setup dialog

Note: the printer settings you make in Ad Hoc are local to Ad Hoc and do not affect other programs.  They are discarded when you exit Ad Hoc.


Print a report

If the report requires a special setup, such as changing the paper bin or specifying landscape orientation, set up the printer

Make sure your printer is on-line

Select the Print Report command on the File menu, or press F9

Highlight the report in the displayed list and select OK
or
Double-click the report in the list

If the report has a report startup dialog, fill out the dialog and select OK

If the report requires a record sort, a sort progress dialog will be displayed

If you have to stop the report while it's printing, select Cancel on the Printing Report dialog


View a report

Select the Display Report command on the File menu, or press Ctrl-F9, to open a report display window

The report display window will display the report selection dialog

If you want to report page size adjusted to fit the display window, see the help topic on adjusting the page size to fit the display window

Highlight the report in the list and select OK, or double-click the report in the list

As the report is generated, the report window title displays the progress.

You may view any pages that have bee generated

When finished viewing the report, double-click the system menu icon on the report window, or select the Close command on the File menu

To stop the generation of the report

Click the Stop Report [image] icon


Adjust the page size of a viewed report to fit the display window

If a report display window is not currently open

Select the Display Report command on the File menu, or press Ctrl-F9, to open a report display window

Select Cancel on the report selection dialog

Click the right mouse button on the report window, or press Alt-M, to display the report window menu

Select the Options command

On the Report Window Options dialog, select the Fit Window option for Page Height and the Custom magnification option.  A suggested magnification to start with is 70 - 80 %.  You can change it later

Select OK

Size the report window as you want

Select the Restart Report command on the report window menu if a report is already loaded, or select the Select Report command on the report window menu to generate a new report


View a report in preview mode

Select the Display Report command on the File menu, or press Ctrl-F9, to open a report display window

Select Cancel on the report selection dialog

Click the right mouse button on the report window, or press Alt-M, to display the report window menu

Select the Options command

On the Report Window Options dialog, select the As Designed option and the Custom magnification option.  A suggested magnification to start with is 70 - 80 %.  You can change it later

Select OK

Select the Select Report command on the report window menu

Follow the steps under the View Report help topic


Zoom the report view

Click the right mouse button on the report display window, or press Alt-M, to display the report window menu

Select the Options command to display the Report Display Window Options dialog

Select the Custom magnification options and enter the desired percentage

Select OK

or, if custom magnification is already set

Press the + key on the keypad to zoom in (increase the magnification) in 5% increments

Press the - key on the keypad to zoom out (decrease the magnification) in 5% increments

using these keys will not affect the option setting on the Options dialog, and selecting OK on the dialog will restore the original setting


Set report display options

Click the right mouse button on the report display window, or press Alt-M, to display the report window menu

Select the Options command

See Report Display Window Options Dialog for help on the options


Print mailing labels

To print mailing labels, you must design a label report.  See help on Label Reports.


Print envelopes

See help on Envelope Reports


Report Design How To's
Report Design Procedures

Up

General Procedures

Creating a new report, retrieving and saving report designs

Design Tools

Using tools on the Report Design Window

Putting data into a report

Including data from the database in reports and using a report startup dialog to set values at print time

Page Layout

Column and line spacing, headers, footers, titles and column headings

Controlling how a report prints

Special Formats


General Report Design Procedures

Up

Create a new report

Use the Quick Report feature

Save a report design

Change a report design

Delete a report design

Make a copy of a report design for a similar report


Report Design Tools

Up

Use the report design window

Use report design fastmenus

Test a report design

Preview a report design


Putting Data into a Report

Up

Include data from the database in a report

Specify a sort and filter

Include a report startup dialog

Specify report data when the report is printed

Specify filter rules when the report is printed


Page Layout

Up

Specify a name and a title for a report

Set margins and page orientation

Space items in the report layout

Set column positions

Specify element margins and indents

Design a page header

Design a page footer

Put the date, time and page number on a report

Assign elements to report regions

Insert an element on a report

Insert a field into a report

Determine the order of elements in the layout

Put borders on regions

Set fonts and line spacing

Specify the same font for several elements

Set tabs

Specify the same tab settings for several elements

Include column totals

Put text in a report

Format Text fields


Controlling how a report prints

Up

Create report breaks to group records

Set page breaks

Printer selection and configuration


Special Formats

Up

Create a report for mailing labels

Suppress blank lines on labels

Create a report for Envelopes


How to Create a New Report
Create a new report

Select the New command on the File menu.

Select one of the three new report options offered.

Follow the steps in Designing Reports, or see other report design how to's.


Use the Quick Report feature

To create a new report as quickly and easily as possible, See Creating a Report Quickly.


Save a Report Design

The report design window must be the active window.

Use the Save command on the File menu, (its enabled only when the report design has been changed) or

Press the F4 key.


Change a report design

Select the Design Report command on the File menu

Choose the report you want to edit.

Make the design changes in the report design window.

Save the report design.


Delete a report design

Select the Delete Report command on the File menu,

Choose the report you want to delete.


Preview a report design

To preview a report you are designing:

Use the Display command on the Report Menu (on the main menu bar when the report design window is active) or

Use the Display command on the report design window fastmenu

This will "print" the report in a report display window.  To preview the report as it will appear on paper make sure you set the As Designed option on the Report Display Window Options dialog.

Change the magnification option on the options dialog to zoom the view of the report in or out.


Make a copy of a report design for a similar report

Select the Design Report command on the File menu, and choose the report you want to copy

Select the Report Layout command on the Report menu, then on the Report Layout dialog change the ID of the report and the name

Save the report under the new name using the Save command on the File menu or the F4 key

If you want to design a base template for several reports and don't want to save it as a report in the database, save it to an .RPT file with the Save to File command on the File menu.  You can read it in later, change the ID and name, modify the design, and then save the new report in the database as above.


Include data from the database in a report

You specify the data from the database that will be included on the report by defining the data view of the report.

Use the Data View command on the Report menu (main menu bar when the report window is active) or the report design window fastmenu to open the Data View dialog.

Specify the primary table for the report as the view's root table and specify any data fields that may be used by the report (either displayed on the report, controlling sort order, etc.)

The fields in the data view are now a part of the report fields list.  To insert a field into the report format, see Insert a field


Specify a sort and filter for a report

Define the sort order and record selection filter for a report in the report's data view.  Use the Data View command on the Report menu to display the Data View dialog.


Include a report startup dialog

Check the Startup Dialog option on the Report Layout dialog

To display the report startup dialog once this option is set, select the Edit Report Startup Dialog command on the Report menu.

To hide the report startup dialog, select the Hide command on the dialog's system menu, or double-click the system menu icon in the top left corner

To remove the startup dialog from the report, un-check the Startup Dialog option on the Report Layout dialog


Specify report data when the report is printed

To be able to enter data that will appear in a report just before you print it:

For each item of data that you want to specify, create a computed field

Add a report startup dialog to the report.  See Include a report startup dialog

Place a control for each of the desired computed fields on the report startup dialog.  See Designing a Report Startup Dialog


Specify filter rules when the report is printed

Create a computed field for each filter rule you want to set at print time

On the Computed Field dialog, specify the database field being filtered as the Equivalent Field

Select the Data View command on the Report menu, then click the Filter button on the Data View dialog to display the Filter Rules dialog.  Select Add to add a new rule.

Specify the database field being filtered and the comparison rule

Select the Field option for the comparison value

Select the appropriate computed field from the comparison field list

Create a report startup dialog for the report and place the computed field on it

For the title of startup dialog control, use language meaningful to the person printing the report such as "Print only for Department" or "Print only for dates between "


Specify a name and a title for a report

Specify the report's ID and name on the Report Layout dialog.  The ID is used as the primary key of the report when its stored in the database.  The name appears on report selection lists.

Specify the title that is printed on the top of each report page by including it as text in the report layout.  See How to design a page header


Set margins and page orientation

Select the Report Layout command on the Report menu

Specify the dimensions of a report page, its orientation (landscape or portrait) and the margins on the Report Layout dialog

Specify Default page orientation if you want the report to be printed with the orientation already set for the printer.  With this option you can change the printer page orientation with the Printer Setup command before the report is printed.

Specify Portrait or Landscape options to override the current printer setting and force the desired orientation


Space items in the report layout

Specify the vertical spacing between elements (such as detail lines) by setting a top or bottom margin, or both, for an element.  See Vertical Spacing of Elements

Specify line spacing within an element, which also affects spacing between elements.  See Spacing Lines of Text in an Element

Specify the horizontal positions of report columns by setting tab stops.  Never use spaces in the text to position columns.

To space elements that repeat in a horizontal direction, such as labels on a label report layout, specify a fixed size, (width and height) for the element.  Set the width of the element equal to the distance between the left edge of one element and the left edge of the next (this is called the pitch)

See Designing Report Elements


Set column positions on a report

Set the locations of columns in a report by using tab stops.  See Setting Report Tabs


Specify report element margins and indents

For help with element margins, see Element Size and Margins

For help with indenting elements in a report, see also Indenting Elements


Design a page header

Use the Regions command on the Report menu to create a new region for the page header.  The header region should be the first region in the regions list

If the next region below the header region is the main area where detail lines will repeat on the report, make sure it is a floating region.

Create an element for the report title.  See Designing Elements. It's trigger should be the Page Header event.

If the report has column headings, create an element for column headings.  It should also be assigned to the header region and to the Page Header event.


Design a page footer

Use the Regions command on the Report menu to create a new region for the page footer.  The footer region should be the last region in the regions list

If the region above the footer region is the main area where detail lines will repeat on the report, make sure it is a floating region.

Create an element for the contents that will appear in the footer.  See Designing Elements. It's trigger should be the Page Footer event.


Put the date, time, and page number on a report

Position the edit cursor at the position in an element edit area where you want the date, time, or page number to appear.

Use the Insert Field command on the Report menu or press the Ins key to select the desired field from the field list


Assign elements to a report region

Define the report region using the Regions command on the Report menu.

Create the element using the Elements command on the Report menu.  All elements in the same region that are triggered by the same event should appear together in the elements list, in the order they are to appear on the report.

On the Edit Element dialog, specify the region the element is assigned to in the Region control.

If you want to quickly insert a new element below an existing element on the report design window, click the edit area of the existing element to place the edit cursor in that element, then press Shift-Ins.  This displays the Edit Element dialog for a new element with the same settings as the existing element.  Edit the element settings then accept the dialog to insert the new element.


Determine the order of elements in the layout

The position of elements in the report is determined by:

The location of the region containing the element

If there are multiple elements assigned to the region with different triggering events, the order in which the events happen after a new page is started determines the order of the elements

If there are multiple elements with the same event, the order the elements appear in the elements list (and the order they are shown in the report design window) determines their order in the report layout.


Put borders on regions

Use the Regions on the Report Menu to select a region to edit.

On the Edit Report Region dialog, select the desired combination of left, right, top, or bottom options

Select the border line style.


Set fonts and line spacing

Select the Fonts command on the Report menu to specify the fonts in the report

Line spacing within an element, by default, is determined by the elements font.  To override the automatic spacing:

Use the Elements command on the report menu to select an element to edit
or

Click the right mouse button in an element edit area to display the element fastmenu and select the Edit Element command

Check the Set to option for line spacing on the Edit Element dialog and specify the line spacing for the element in points.


Specify the same font for several elements

Select the Fonts command on the Report menu

On the Fonts dialog, highlight the entry for Default Report Font and specify the font to be used

For each element that will have this font, highlight that element in the Fonts dialog list and check the Use default option.


Specify the same tab settings for several elements

You can specify a common set of tabs for a report that several elements can share.

If the common report tabs have not been defined, select one of the elements that will have the common tab settings by clicking on its edit area in the report design window.

Click the right mouse button in this edit area and select Edit Element from the element fastmenu.

Check the Use common report tabs option on the Edit Element dialog.

Set the tabs on the ruler.  See Setting Report Tabs.

Check the Use common report tabs for all other elements that will share the common tab settings.


Set tabs

See Setting Tabs

For help on setting common report tabs for several elements, see the HowTo on setting the same tabs for several elements.


Insert an element on a report

Use the Elements command on the Reports Menu to display the Report Elements dialog

Select the Add command to add the element to the end of the list, or the Insert command to insert the element at a specified position.

or

To insert a new element below and existing element, click the right mouse button on an element edit area of the existing element

Select the Insert Element command on the element fastmenu

or

Position the edit cursor in the area of the existing element and press Shift-Ins.

Fill out the Edit Element dialog, the accept the dialog.  An edit area for the element will appear on the report design window.


Insert a field on a report

A database field must be defined in the report view before it can be included on the report

Position the edit cursor in the element edit area where you want to insert the field

Select the Insert Field command on the Report menu or press the Ins key

Select the field from the field list and press Enter;


Include column totals

Create a new element for a total line

Assign an event to the element

for report totals, assign the Report Footer event (not Page Footer)

for subtotals for record groups, define a break level, and assign the Break Footer event associated with this break level

Assign the element to the same region that the detail lines are in.  You can create extra space above or below it by giving it top and/or bottom margins.

Create a counter field for each column in the report for which you want a total, count, or average. Counter fields are defined on the Data View dialog.

Insert the counter field at the appropriate location in the element


Put text in a report

To include text that is part of the report design, such as the report title, column headings, etc. by positioning the edit cursor at the appropriate spot in an edit element area and typing the text.

To include text that is determined at the time the report is printed, create a computed field and insert it at the appropriate spot in an element.  Then include the field on the report startup dialog.


Format Text fields

When you include fields of type Text on a report, follow these guidelines:

To have the most control over the format, don't put text fields on the same line in an element with other fields.  Put each Text field on a different line, or better yet, give each text field its own element so you can specify a set of tabs just for that field.

Specify the Word Wrap option for an element containing a Text field (See Edit Element  dialog).

If the contents of the Text field contains tab characters, set the element tabs accordingly.

To indent a Text field, specify a left margin for the element.


Printer selection and configuration

Use the Printer Setup command on the File menu to select and configure a printer on the Printer Options menu.

To include printer options in a report design, click the Printer Options button on the Report Layout dialog.

To override printer settings when a report is printed, click the Printer button on the report startup dialog.


Create report breaks to group records

See Report Breaks .


Set page breaks

Automatic page breaks occur when a region is filled up and its time to print the next element in that region.

You can force a page break either before or after an element is printed. See Specifying Page Breaks.


Create a report for mailing labels

To create a new report for printing labels, see Label Reports.


Suppress blank lines on labels

To keep blank lines from printing on labels, check the Don't print blank lines option on the Edit Element dialog for the label element.  This option works for any element on any type of report.


Create a report for envelopes

See Envelope Reports


Use the Report Design Window

See Report Design Window

See Designing Reports


Use report design fastmenus

A fastmenu is a menu that pops up when you click the right mouse button over certain areas.  The menu contains commands associated with the object or area you clicked.

There are several fastmenus for the report design window:

Click on an element edit area to display the element edit menu for that element

Click on a tab on the ruler to display the tab menu, which enables you to set the tab alignment type

Click anywhere else on the ruler or on the report window client area not covered by an element to display the report design fastmenu, which has most of the commands on the main Report menu on the main menu bar


Test a report design

Select the Display  command on the Report menu to preview the report in a report display window

Select the Run Diagnostics  command on the Report menu to run a diagnostic test on the design of the report


Databases

Introduction to Databases

Tables Window

Creating a New Database

Designing a Database

Database Maintenance

Database Diagnostics


Creating a Database
Creating a New Database

See Also	Procedures

Before you create a database, decide how you want to organize your data into tables.  See Introduction to Databases if you are unfamiliar with database concepts.

Create a new database - procedure overview

1.	Select the Create New Database command on the Tables menu if a database is currently open.  If no database is currently open, this command is on the File menu.  If a database is currently open, Ad Hoc will ask if you want to close it.  Respond Yes.

3.	Describe the new database on the New Database dialog, then choose OK.  Ad Hoc will create the database system files for the new database and then open the database, with the Tables Window displayed.  If the Tables Window is not visible, select the Tables Window command on the View menu to display it.

4.	Add table definitions to the database using the New Table  command on the Tables menu to display the Database Table dialog.  Use this dialog to define the table, including its fields, indexes, and links to other tables.

5. Define links between tables, particularly to specify lookup tables for fields and specify referential integrity options.

6.	Design data entry forms and lists and save them in the Forms table.  See Designing Forms and Designing Lists.

7.	Design reports and save them in the Reports table.  See Designing Reports.

Database ID and System Files

A database must have an identifier up to seven characters long. Ad Hoc uses the identifier to construct the names of the system files of the database.  Each database that you create must have its own directory for its system files.  Files for your data tables are usually also in this directory, but you can place them in other directories, and two databases can even share a database table.


Introduction to Databases

Designing a Database

Adding Tables

Designing Tables

Editing Table Definition Command

Designing Forms

Designing Lists

Designing Reports


Designing a Database

See Also

The Create New Database command initializes a new, empty database.  After you create a new database, you have to define the types of data it will contain by defining tables. When a table is added to a database, Ad Hoc creates a table file on your disk to hold the data in the table.

Tables are defined and added to the database using commands on the Tables window.  When the Tables window is open on the desktop, you can use the following commands on the Tables menu to add and define tables:

Select	To

New Table command	Add a new table to the database

Edit Table command	Change the definition of a table
Add or change fields in the table,
Define indexes for the table,
Define links to other tables

Delete Table command	Remove a table from the database


Creating a Database

Designing Tables

Editing Table Definitions

Designing Forms

Designing Lists

Designing Reports


Changing a Database
Changing a Database Design

See Also

You can modify the design of the database at any time by:

Adding or removing tables in the database

Changing the design of a table

Redefining the relations, or links between tables

You cannot change the identifier of an existing database.  You can however, change the name of the directory the database is located in, or move the database to another directory, with the following restrictions:

Only one database (i.e., a set of database system files) can exist in a directory.

All the system files of a database must be in the same directory.

Note:  You cannot edit a table definition or rebuild a table file from the Tables Window if there are other desktop objects (forms, lists, report design windows) open on the desktop.  This is to guard against possible data integrity errors if you change the structure of a database table that a desktop object is designed around.


Creating a New Database

Edit Table Definition Command,

 Designing a New Table


Deleting a Database

To delete a database table (including its definition in the data dictionary and optionally the physical file that corresponds to it), use the Delete Table command.

Ad Hoc does not have a command for deleting an entire database.  To remove a database from your disk, use the Windows File Manager or a DOS command to delete all the files. in the database subdirectory, including the system files and the files corresponding to your database tables.


Designing a New Table

See Also	Procedures

This topic provides an overview of the process of designing a new database table.  For detailed help with creating and editing a table definition, see the Users Manual.  You can click See Also and Procedures above for related topics.

Table Design Overview

1.	Decide on an identifier and a name for the table.  The identifier is used for storing the table definition in the data dictionary. No two tables can have the same name or identifier.

2.	Use the Database Table dialog to specify information about the table, such as the tables file name and the directory (path) in which it will be placed.  It is usually best to use the default file name provided by Ad Hoc (the table identifier followed by the extension .DBF). Leave the Directory entry blank if you want the tables file to be located in the same directory as the data dictionary and system files.

3.	Decide on the data items, or fields, that will be contained in each record of the table.

4.	Decide which field will be the primary key for the table.  You will indicate the primary key field when you define the first index for the table.

The primary key should be a field that has a unique value in each record, so that it can be used to identify the record.  This is particularly important if the table is linked to other tables as a lookup table.  In unusual circumstances, the primary key for a table could be made up of two or more fields, but it is recommended that only one field be used.

The primary key field must be marked as "Non-null values required".  The primary key field must also be a data type that can be used in an index.  Data types allowable for primary key fields are Character, Long Integer, Short Integer, Numeric, and Date.  Text fields cannot be used for an index.

5.	Add fields to the table definition.  Select Add on the Database Table dialog to display the Define Field dialog, which enables you to define a new field.

6.	Define the indexes for the table.  Click the Index button on the Database Table dialog to display the list of indexes for the table.  Select Add to display the Define Index dialog, which enables you to define an index.

You must define at least one index for a table.  Indexes are numbered starting with 0, and the first index in the list, index  0, is the primary key index.  Enter the field (or fields) that you are using for the primary key into the list of segments for this index.   Don't check the Modifiable, Duplicates Allowed, or Nulls Allowed options for this index.  If you have a specific reason for making the primary key index modifiable or duplicates allowed, Ad Hoc will let you get away with a warning, but this could cause problems if you are defining links between tables.

7.	Add additional indexes to the table as required for the most common sort orders you will be using for forms, lists, and reports.

8.	Add the definitions for links to other tables if desired.  Select the Links button on the Database Table Dialog to display the list of links for the table.  Select Add to display the Define Link dialog, which enables you do define a table link.

9.	When you select OK on the Database Table dialog, Ad Hoc will validate your table design and add it to the data dictionary It will also create a new DOS file for the table.

10.	Run Diagnostics on the table to check your design.

You can change the fields, indexes, and links in a table at any time.  If you change field or index definitions for a table that contains data, Ad Hoc will rebuild the table file to match the new table definition.


Adding a Table

Editing a Table Definition

Database Table Dialog

Define Field Dialog

Define Index Dialog

Define Link Dialog

Primary Keys and Indexes

Table Links


Database Maintenance

Ad Hoc system files database files actually require no maintenance unless they become damaged by a power failure, a disk failure, or some other system disaster.

Back up Your Files

You should make a backup copy of the files on your hard disk on a regular basis.  If your database files are deleted or irreparably damaged, the only way to recover your data is to restore the affected files from a backup copy.  Ad Hoc does not provide a backup command, so you must use a commercial backup program or the DOS backup program.  If you have a large disk filled with data, we highly recommend a tape backup system.  The safest backup policy is to back up files that change regularly every day, and rotate several sets of backup disks or tapes.

Missing Database Table Files

If the Tables Window shows a status of No File for a table,

1.	Check the file name and path name specified for the table on the Database Table dialog (next two steps).

2.	Highlight the table in the Tables Window list

3.	Select the Edit Table Definition command on the Tables menu

4.	Use the Windows File Manager to check that the file specified is in the database directory or, if a different path is specified on the Table Definition Dialog, in the directory specified by the path

5.	If the file is not on your disk, restore it from a backup.

6.	If restoring from a backup fails, your only recourse is to make sure the table with the missing file is highlighted, then select the Empty Table command on the Tables menu to create a new, empty file for the table.

Damaged Database Table Files

If the Tables Window shows a status of Error in file for a table,

1.	Save any changes you have made to form or report designs, and exit Ad Hoc.

2.	Start Ad Hoc again, and display the Tables Window by selecting the Tables Window command on the View menu.

3.	If the table file is still shown as having an error, attempt to rebuild the file.  Highlight the damaged table in the Tables Window list.

4.	Select the Rebuild Table File command on the Tables menu, and tell Ad Hoc Yes, you want to rebuild the table file.

5.	After the rebuild process is completed, click the OK button on the progress display window.

6.	If the table is still indicated as damaged, you will have to restore it from your latest backup.

Note:  If a number of tables (or all of them) in the Tables Window list are shown with file errors, there may be a system error in your hardware, DOS, Windows, or the Ad Hoc record manager.  In this case, before rebuilding or restoring from a backup, close all your applications, quit Windows, reboot your system, and then reopen Ad Hoc.

Using the Rebuild command to shrink a database file

As records are added to a Ad Hoc table, the size of the table file expands.  As records are deleted, the file size remains the same, but the space for the deleted records is kept track of.  As new records are again added, the space of the old deleted records is used first before expanding the file.

If you have a database file with a lot of addition and deletion activity, and a large number of records have just been deleted, you can shrink the size of the file if you want (its not necessary unless you need the disk space), by rebuilding the table file with the Rebuild Table File command on the Tables menu.

Note:  You cannot edit a table definition or rebuild a table file from the Tables Window if there are other desktop objects (forms, lists, report design windows) open on the desktop.  This is to guard against possible data integrity errors if you change the structure of a database table that a desktop object is designed around.


Diagnostics

Ad Hoc contains several diagnostics routines that you can run to check

the design of a form or list

the design of a report

the database table definitions stored in the data dictionary

The diagnostics report is displayed in the Diagnostics Window

The diagnostics checks are automatically run every time you open a form, list, or report window on the desktop, or print a report.  The database diagnostics are run every time you start Ad Hoc or open a new database.  When these automatic checks are run, Ad Hoc will display the results only if the severity of any errors encountered exceeds a threshold set on the Diagnostics Options dialog.

If fatal errors are encountered for a report, you can't print the report until the errors are corrected (See Designing Reports).  If less severe errors are found, you have the option of continuing or canceling the report.

You can run the diagnostics routines at any other time by selecting the Run Diagnostics command on the appropriate menu

To Check 	Use

A Form	Run Diagnostics command on the Form Run menu or the Form Design menu

A List	Run Diagnostics command on the List Run menu or the List Design menu

A Report	Run Diagnostics command on the Report menu when a report design window is active, or the pop-up menu of a report display window

A Table Definition	Run Table Diagnostics command on the Tables menu when the Tables Window is active

All Tables	Run Database Diagnostics command on the Tables menu


Diagnostics Window

The results of diagnostics tests are displayed in a pop-up window that contains a description of what was tested, and a scrolling list of messages for each warning or error found.  At the end of the report is a summary of the number of errors found.  Select OK to close this window.

When errors are found before printing a report, the diagnostics window contains an OK and Cancel button.  Choose OK to continue the report, or Cancel to cancel it.

Error Levels

There are four levels of errors reported.

Level	Description

Comment	An unusual design that is probably OK, but might be the cause of a minor problem in a form or report

Warning	A situation that will cause unexpected results.  Nothing major, but should be corrected

Error	A problem that will cause unexpected results in a form or report output.  A problem in a table definition that will cause problems elsewhere and should definitely be corrected

Fatal	A serious problem in the design of a form or report (or a table definition) that keep the form or report from working

Diagnostic Checks

The current version of Ad Hoc checks only for major design oversights, or incompatibility between the database and a form or report design.  There are problems that could exist that aren't caught by the diagnostics routines.  These will usually be apparent when you display a form or print a report.

Form Diagnostics

List Diagnostics

Report Diagnostics

Database Diagnostics


Form Diagnostics

The following form design errors are checked:

Invalid root table ID in the view definition

Invalid field IDs in the view definition

No fields defined

Invalid field IDs in the sort specification

Invalid field IDs in the filter definition

No input controls on the form

Controls assigned to invalid fields

Controls assigned to fields of the wrong data type

Controls with an invalid size or position on the form

Search window has a different sort specified than the main form

Invalid fields defined on a lookup window

An imbedded list not linked to the main form (comment only)


List Diagnostics

The following list design errors are checked:

Invalid root table ID in the view definition

Invalid field IDs in the view definition

No fields defined

Invalid field IDs in the sort specification

Invalid field IDs in the filter definition

Invalid fields assigned to display columns


Report Diagnostics

The following report design errors are checked:

Invalid root table ID in the view definition

Invalid field IDs in the view definition

No fields defined

Invalid field IDs in the sort specification

Invalid field IDs in the filter definition

Invalid fields defined for report breaks

Invalid fields inserted into the report layout

Invalid target field for a total field

Invalid clear event for a total field

Element assigned to an invalid event

No regions defined

No report elements defined

Region contains no elements

Region is designated as "size to elements", but contains no elements of fixed size

Two floating regions together, or between non-fixed regions

Element assigned to an invalid region


Database Diagnostics

Diagnostics checks are performed on the table definitions in the data dictionary.  The following errors are checked:

No file name specified for the table

The specified file could not be found

Invalid pathname specified for the table file

Specified file was found, but could not be opened.

No fields defined for a table

No indexes defined for a table

Primary key index (0) defines a modifiable, duplicates allowed, or nulls allowed

Primary key index field not defined as required (no nulls allowed)

Invalid field defined for an index

Field of wrong data type defined for an index

Invalid table ID in a link definition

Invalid fields in a link definition

Fields specified in a link don't match primary key of associated table


Introduction to Databases

What is a Database?

Primary Keys and Indexes

Table Links

Types of Data

Data Views

Forms

Reports

Creating a Database

Database Maintenance

Diagnostics


What is a Database?

See Also

Ad Hoc, like most database management systems, organizes your data in a database.  An Ad Hoc database contains data, information describing how the data is organized, and information that makes it easy to enter and retrieve data in meaningful ways.  A database also contains designs for data entry forms and browse lists for entering and editing data, and report formats which are used to display or print reports.

Tables

The data in a database is structured in units called tables.  Each table contains related items of information, usually associated with a person or thing.  For example, in the sample database that came with Ad Hoc, the EMPLOYEE table contains information about employees and the DEPT (Department) table contains information about the departments in the company.

A table can be pictured graphically as organized in a row and column format:

The columns of the table are the items of data contained in the table.  These are called fields.  The rows of the graphic represent the records in the table.  A record contains the information for a particular person or object.  For example, the EMPLOYEE table contains a record for each employee.

Indexes

An index is used to retrieve records from a table in a particular order.  You can define a number of indexes, depending on the order that you want to display records in a list or in a report.  An index is defined by the fields used to sort the records.  Each field is a segment of the index.  For example, an index used to sort employee records alphabetically contains two segments: the employee last name and employee first name.

See Primary Keys and Indexes.

Table Links

Table links can be included in the definition of a database table in Ad Hoc.  A  table link defines a relationship between two database tables, by specifying a field (or fields) in one table that can be matched with the primary key field (or fields) in another table.  Table links are used for a number of purposes.  If a field in a table has a link to another table, then the other table becomes a lookup table for that field.  When you enter data for the field on a form, Ad Hoc automatically validates the entry against the linked table.  The link also makes it possible for data entry forms to provide a pop-up lookup window for that field, from which you can select a value.  Another use of table links is to help you easily construct multi-table views of the data, allowing you to include fields from more than one table on a form or report.  Finally, links are used to specify referential integrity options for the database.

See Table Links.

Data Views

A data view is a customized view of data in the database for use in a particular form, browse list, or report.  A view is made up of fields from one or more tables in a database.  A view is like a table in many respects, in that it contains records, has a sort order for the records, and can have a filter to select specific records from the database.  The records of the view are not stored physically, but are constructed from the records of the tables contained in the view.

See Views for a more detailed description.


Creating a Database

Designing a Database

Designing a Database Table


Primary Keys and Indexes

See Also

In Ad Hoc, at least one field in each table must be designated as the primary key.  The primary key provides a unique identifier for each record in the table.  No two records can have the same value in the primary key field.  Usually, the primary key is a single field, but can be defined as several fields.  As an example, an employee record contains the employee ID.  Since each employee must have a unique ID, the employee ID is a good choice for the primary key of the employee table. Other examples of primary keys that you are familiar with are your social security number and your charge card account numbers.  If your database table doesnt have an obvious primary key field, you can invent one, such as a sequential number, or for a mailing list database, the first few letters of the addressees last name.

When you define a database table, you can define one or more indexes for the table.  An index defines a particular sort order for the records in a table, and provides a way to quickly retrieve a record without having to search through all the records in the table one by one.  Indexes are defined by the list of fields in a table used to sort the records for that index.  The fields you select to define an index are called index segments, and an index can have one or more segments.

The first index that you define for a table (index number 0) is always considered in Ad Hoc as the primary key index.  A primary key index is required for each table.  You can define additional indexes for a table so that you can retrieve records in other sort orders more suited for a particular application.  For example, you may want to define an index for the employee table that consists of the employee's last name and first name, so that you can retrieve records alphabetically.

When you design a form, list, or report, you can use a table index to sort records, or you can define a sort order using any fields in the data view. The difference between a form or report sort and an index is that an index is maintained by Ad Hoc as you add and delete records from a table. As a result, an index is always instantly available to order records in a table.  If you define a sort for a report that matches one of the indexes of the table being used for the report, Ad Hoc will automatically use the table index.  If you define a report sort that does not match  an index, Ad Hoc must sort the records each time you print the report.


Designing a Database Table

Define Index Dialog

Define Link Dialog


Table Links

See Also

Ad Hoc is different from many relational database managers in that it stores the ways the various tables in the database can be related to each other.  In Ad Hoc, the relation of one table to another is called a table link.  Links between tables always involve the primary key of one table, and an equivalent field (or set of fields in the other table).  If you are designing a report based on one table (lets call it the primary table), but want to include fields from another table (lets call it the related table), the definition of the primary table in the data dictionary must include a link to the related table.

The table link defines how records in the related table are matched with records read from the primary table.  Identification of the records in the related table is done using that tables primary key.  To define a link to a related table from the primary table, you must include a field (or fields) in the primary table that match the primary key field (or fields) of the related table.  The field (or fields) in the primary  table is called a foreign key because it  can be used to match the primary key of another table.  Each foreign key field must match the other table's corresponding primary key field in data type and size.

As an example, in the sample database there is a table for employee information and a table for department information.  You want to design a report containing employee information and some information about the department that each employee works in, sorted by employee.  Instead of keeping all the department information duplicated in each employee record, which would waste space and make it very difficult to keep the department information updated, you keep the department information in the department table, one record per department.  The primary key of the department table is the department id.

One field in the employee record is the id of the department the employee works in.  This field in the employee record is a foreign key to the department table, and can be used to link a particular employee record to a department record.  To relate, or link, these two tables, You would define table link for the employee table that links the employees department to the correct record in the department table.  When you print a report on employees and want to include fields from the department table, Ad Hoc uses the table link to automatically retrieve the appropriate department record for each employee record.


Designing a Database Table

Define Link Dialog

Referential Integrity


Referential Integrity

Referential integrity is a feature of Ad Hoc that ensures that references from records of one table to records of another table remain valid when records are deleted.  This is best illustrated using an example from the sample database.  When you define a link from one table (Table A) to another table (Table B), the field (or fields) in Table A that define the link refer to records in Table B.  This allows Table B to become a lookup table for the linked field(s).  The records in Table A are dependent on the referenced record in Table B.  If a record in Table B is deleted, the fields in the dependent records in Table A become invalid.  In some cases, the entire dependent record becomes invalid and should be deleted if the record in Table B is deleted.

The referential integrity feature fixes the invalid dependent records.  When you define a link, you can specify one of the following options for dealing with dependent records:

No action  Dont use the link for referential integrity

Set the linked fields in the dependent records to null values (only if the linked fields can have null values )

Delete the dependent records

Dont allow the master record to be deleted if there are dependent records

There may be several tables that have links to a master table, and you can define these options separately for each link.  When you want to delete a record in a table (or view), the record is deleted only if all the dependent records can be updated or deleted.

Note:  Referential integrity only applies when records are deleted. If you have specified the  modifiable attribute for the primary key of the linked table, and you change the value of the primary key of a record, Ad Hoc will not change the value in the dependent records defined by the link.  This is one reason Ad Hoc warns you if you select the modifiable option for a primary key.

See Link Options Dialog for information on defining the referential integrity options associated with a link.

Example  The employee table has a link from the DEPT field (the department the employee works in) to the Department table.  This link is used to validate values you enter  in the DEPT field against valid values for Department ID in the Department table.  For each record in the Department table, there may be many records in the Employee table that refer to this department (the DEPT field in Employee is equal to the DEPTID field in Department).  These Employee records are dependent records of the Department record, which is the master record.  If you were to delete  the department record, the DEPT field value in the dependent employee records would be invalid.  Referential integrity ensures that when you delete the department record, the dependent employee records are fixed.  In this case, since the DEPT field is not a required field, the fix would be to set the DEPT field to a null value in each dependent record.

Another Example  The Personnel Actions table is a table of detail personnel action records for employees.  It has two links, one to the Employee table, and one to the Personnel Actions Master table that defines the action codes used in the Personnel Actions table.  If you delete an employee record, you would specify that the dependent personnel action records should be also be deleted.  On the other hand, you would not want to delete a record in the Personnel Actions Master table while there were still employee personnel action records that referred to it, so you would select a the do not delete if dependent records option for the link to the Personnel Actions Master table.


Data Views

See Also

A data view is similar to a table in that it contains records that in turn contain fields.  However a view is not physically stored anywhere, as all of its records are assembled from fields from one or more tables in the database.  Think of a view as a temporary table that is built using information from other tables for the purposes of printing a report or displaying data on the screen.

An Ad Hoc data view is based on a primary table.  The indexes of the primary table are also indexes of the view, and the fields of the primary table can be selected as fields of the view.  In addition to the primary table fields, however, the view record can also contain fields from any other related table (or linked table) for which the primary table has a link defined.  You can also select fields from tables that are not related to the primary table, but are related to a table that is in turn related to the primary table.

The records of a view can be sorted for a form, list, or report using any field in the view, regardless of the table the field comes from.  However, only the indexes of the primary table can be used as indexes of the view.

You can also define a filter for a view.  A filter is a set of rules that define a selection, or subset, of all the records in a view.  (For example, a filter can be define for an employee report to select only employees in the sales department.).


Defining Data Views

Edit View Dialog

Extended Field ID


Forms

See Also

Once you have defined the structure of your database, you need a way to enter data, and viewing it on the screen.  To enter data into the database, you use a special data entry screen called a form.  A form is one type of desktop object that appears on the Ad Hoc main program window.  Ad Hoc allows you to design and store any number of forms in the database.

There are two types of forms.

Data entry forms (referred to as just "forms" in Ad Hoc), display the fields from one record at a time and allow you to edit the content of the fields.  A form is similar in layout to a paper form that has blanks to fill in.

Lists (also referred to as browse lists) display the data in a row and column format, allowing you to see many records at a time and easily browse through a table.  These two types of forms can be combined in several ways to give you powerful data entry and display tools.

When you design a form, you design a data view associated with the form.  You can place the fields of the view on the form, define form colors and fonts, define the sort order of view records, define the filter that will select records that will be displayed, and designate other characteristics that tailor the form for a particular purpose.


Using Forms

Using Lists

Designing Forms

Designing Lists


Reports

See Also

Ad Hoc has a very flexible report designer that allows you to design and store many types of report formats, including "row and column" reports, form letters, envelopes, and mailing labels.  Reports, like forms, are associated with a database view that can contain fields from one or more tables in the database.  You can designate a sort order and selection filter for the report and design the layout of information on the report, including margins, tabs, placement of data and text, repeating regions, fonts, line spacing, report breaks, and other layout characteristics.


Printing Reports

Designing Reports


Procedures for Forms

Up

General Procedures

Opening and closing forms

Using Forms to Edit Data

Adding, changing, deleting records

Other Procedures

Saving desktop layouts, Linking forms on the desktop

Procedures for Designing Forms


General Form Procedures

Up

Open a form

Close a form

Close all objects on the desktop

Remove a form from the database

Save a form design to an external file

Read a form design from an external file


Using Forms to Edit Data

Up

Scroll through records on a form

Find a record

Change the sort order of a form

Change the record selection filter

Move the edit cursor to a control

Move the focus to a scroll region

Look up values for a field

Edit a record

Canceling changes to a record

Add a new record to the database

Delete a record

Edit a record displayed in a scroll region

Start a new line in a text box control

Insert a tab in a text box control


Other Form Procedures

Up

Link a form to another

Unlink a form from another

Attach a report to a form

Print the current record on a form

Detach a report from a form


Open a form or list

Select the Open command on the File menu to display the Open dialog

Make sure the Forms (or Lists) option is checked on the Open dialog

Select the form or list you want to open by highlighting it in the list, then pressing Enter
or
Double click the entry


Close a form or list

Make sure the form or list you want to close is the active form

Select the Close on the File menu
or
Select the Close command on the form's (list's) system menu
or
Double-click the form's (list's) system menu icon


Close all objects on the desktop

Select the Close All command on the Window menu.


Remove a form or list from the database

Select the Delete from the File menu.

Select the form (list) you want to delete

Confirm the deletion


Save a form or list design to an external file

Select the Save to File from the File menu.

If this command is grayed out, put the form (list) in design mode and then leave design mode

Specify the file name and location on the File Save As dialog.  The file will have a .FRM suffix

Saving a form (list) design to a file this way is not considered saving the form (list) in the database.  A form or list is not considered "saved" by Ad Hoc until you use the Save command on the File menu.


Read a form or list design from an external file

Select the Read From File command on the File menu

Use the Open File dialog to select the .FRM file you want to read

Only valid .FRM files written from the current database can be read in this way


Scroll through the records on a form

Click a control pad icon or press a key combination or select a command from the Form menu to display records in the sort order of the form:

Icon	Keystroke	Menu command

First record 	 	Ctrl-F	First

Previous record	 	Ctrl-P	Previous

Next record	 	Ctrl-N	Next

Last record	 	Ctrl-L	Last

Hold the mouse button down on the Previous and Next icons for auto repeat.


Find a record

If the form has a search window:

Click the Search Icon [image]  or press Alt-S or select the Search command on the Form menu.

Enter a search key in the search window search control (See Using a Form Search Window) or scroll up and down the list to highlight the selected record.

Click the OK button to select the record


Change the record selection filter

Click the Set Filter icon [image] or select the Filter command on the form menu.

Edit the filter rules on the Filter rules dialog

Select OK to set the filter

 Filter rules set this way are not stored permanently in the form design unless you subsequently save the form.


Change the sort order of a form

If the form has a search window:

Click the Search Icon [image] or press Alt-S to open the search window

Select the desired sort order in the Sort control of the search window

Press Esc to close the search window

If the form has no search window or the desired sort order is not in the sort control list, you must specify the sort order on the form's view in design mode. See Defining Data Views.

If there is a sort order that you will use frequently for a form, add an index for it to the root table of the view.


Move the edit cursor to a control

Use the Tab key to move the focus (indicated by the flashing edit cursor) to the next control in tab order

Use Shift-Tab to move in reverse order

or

 Click the left mouse button on the control

Note:

You cannot set the focus on a control that is read-only

You cannot remove the focus from a control that has an invalid value.  Correct the entry, or cancel the update.


Move the focus to a scroll region

You cannot tab into a scroll region.  Instead,

Press the F6 key to move the focus from the main form to a scroll region
Press F6 again to move to the next region or back to the main form

or

Click the left mouse button inside the scroll region.

When the scroll region has the focus, you can use the arrow keys or keystroke navigation to move the selection highlight.


Look up values for a field

For fields that have validation rules defined, or fields for which a link is defined to another table, you can open a lookup window to select a value.

Move the focus to the control for the field, the Lookup icon [image] will appear on the form's control pad

Click the lookup icon with the left mouse button
or
Click the right mouse button on the control
or
Press Alt-<up arrow>

Select the desired value from the lookup list and press Enter or double-click the entry


Edit a record on a form

Use the search window or the Next and Prior commands to display the record on the form

Tab to the control that you want to change, or click it with the mouse

Change the field by selecting text you want to replace and deleting by typing a new entry or pressing the Del key.  New text that you type is inserted at the edit cursor.

When you make the first change to the record, it goes into update mode.  The Update [image] and Cancel [image] icons appear on the control pad.  If record locking is enable, the record is locked.

Make changes to other fields as desired

Accept the changes by clicking the Update icon or pressing the Enter key.

Cancel the changes and restore the original record by clicking the Cancel icon or pressing the Esc key.


Cancel changes to a record

Cancel changes you have made to a record by clicking the Cancel [image] icon, or pressing the Esc key.  Once you have updated the changes to a record by clicking the Update icon or pressing Enter, you cannot cancel the changes.  You have to re-edit the record.


Add a new record to the database

Click the New Record [image] icon
or
press the Ins key
or
Select the New command on the Form menu

The form is blanked out, and the controls for the non-modifiable fields are enabled in preparation for the new record

Fill out the form and click the Update icon or press Enter

To cancel the new record, click the Cancel icon or press Esc


Delete a record on a form

Display the record on the form using the search window or the Next and Prior commands

Click the Delete Record [image] icon
or
Press Ctrl-D
or
Select the Delete command on the Form menu

If the delete record confirmation option is on, Ad Hoc will ask you to confirm the deletion


Edit a record displayed in a scroll region

If a form has a scroll region (which contains an embedded list) and the list is designed to edit records:

Press F6 or click on the list to move the focus to it

Scroll the list to highlight the record to edit

Press the list Edit button or double-click the entry

Edit the record on the pop-up form

Press Enter to accept the changes or Esc to cancel them

See Using Lists for details.


Start a new line in a text box control

Position the caret (edit cursor) at the location in the text box where you want to start a new line

Hold the Ctrl key and press the Enter key


Insert a tab in a text box control

Position the caret (edit cursor) at the location in the text box where you want to insert a tab

Hold the Ctrl key and press the Tab key

Tab stops in a text box on a form are fixed.  On a report layout, the tabs in a Text field will align with the tab stops you set on the ruler.


Link a form or list to another

Activate the master form (list), the form (list) that will control the link

Select the Form Links command on either the File menu or the Form (List) menu of the master form (list).

On the Form Links dialog, select the linked, or slave, form or list in the list of Unlinked Forms on the Desktop.

Double-click the form (list) in this list, or highlight it and choose Link

On the Edit Link  dialog, select a field of the slave form's (list's) view in the list on the left

Fields from the master form's (list's) view that can be used to match the selected slave field will appear in the list on the right

Select a master form (list) field.  The link rule will be displayed on the dialog.

You can define a link with more than pair of matching fields

Select OK on the Edit Link dialog, to create the link

Select OK on the Form Links dialog

See Linking Forms for examples.


Unlink a form or list from another

Close either form (list) to break a link

or

Active the master form (list) of the link

Select the Form Links command from either the File menu or the Form (List) menu

On Form Links dialog, select the linked form (list) in the Linked Forms list

Click the Unlink button to unlink the form (list)


Attach a report to a form or list

Select the Attach Report command on the Form (List) menu

On the Attached Report dialog, use the Select button to select a report to attach.  The root table of the report must be the same as the root table of the form (list)

Select OK  a printer icon will appear on the control pad of a form

The report is opened (started) when you print the first record

See Attaching a report


Print the current record on a form

Attach the desired report to the form (list)

Display the record on the form or select it on the list

Select the Print Record command on the form (list) menu

On a form, you can click the printer icon on the control pad

See Attaching a report


Detach a report from a form or list

Select the Attach Report command on the Form (List) menu

Select Clear on the Attached Report dialog

Select OK on the dialog


Form Design How To's
Procedures for Designing Forms

Up

General Procedures

Creating a new form, editing and saving form designs

Specifying Form Data

Defining the data view, sort specification, filters

Form Layout

Laying out controls on the form, sizing and positioning forms on the desktop, layout tools

Special Features

Including a search window, lookup windows

Procedures for Using Forms


General Form Design Procedures

Up

Create a new form

Change a form design

Save a form design

Switch between run and design mode

Change the size of a form

Set the location of a form on the desktop

Include a search window

Design a form for importing or exporting data

Delete a form

Check the design of a form


Specifying Form Data

Up

Define the data view of a new form

Select the fields for a form

Specify the sort order

Specify a filter

Specify fields used in lookup windows


Form Layout

Up

Display a field on a form

Place a control on a form

Change the attributes of a control

Change the title of a control

Change the border style of a control

Make a control display-only

Change the size of a control

Move a control

Remove a control

Change an edit control to a combo box

Select a group of controls

Un-select controls

Move a group of controls

Align selected controls

Make selected controls the same size

Set the tab order of controls

Specify form fonts

Specify form colors


Special Features

Up

Include a search window on a form

Include lookup windows for fields

Specify the columns in a lookup window


Create a new form

Select the New command from the File menu

Select the option for a new form

See other How To's for details on these steps:

Enter an ID and Name for the new form, and fill out other options as desired on the Form Attributes dialog.

Define the data view for the form on the Data View dialog.

A new form will open on the desktop in design mode

Create and place controls on the form

Design the search window if you selected that option on the Form Attributes dialog

Run form diagnostics by selecting the Run Diagnostics command on the Form Design menu.

Leave design mode by selecting the Leave Design Mode command on the Form Design menu.

Save the form.


Change a form design

Open the form by selecting the Open command on the File menu, then selecting the form from the list of stored forms.

Place the form in design mode by selecting the Design Mode command on the Form menu.

Make the desired changes

Leave design mode by selecting the Leave Design Mode command on the Form Design menu.

Run diagnostics on the form by selecting the Run Diagnostics command on the Form menu.

Save the form.


Save a form design

Ad Hoc will save a form design only if the form is in design mode, or if the form design has changed.

Make sure the form is the active desktop object

If this is a new form, make sure the ID and name you entered on the Form Attributes dialog aren't duplicates of another form already in the database.

Select the Save command on the File menu
or
Press the F4 key


Switch to and from design mode

To put a form in design mode

Click the right mouse button when the cursor is over any uncovered area of the form

Select the Design Mode command on the Form menu

To take a form out of design mode

Click the right mouse button when the cursor is over any uncovered area of the form

Select the Leave Design Mode command on the Form Design menu


Delete a form design

To remove a form design from the database

Select the Delete command on the File menu.

Select the form from the list of stored forms

Confirm that you want to delete the form


Check the design of a form

Select the Run Diagnostics command on the Form menu or the Form Design menu


Change the size of a form

Place the form in design mode by selecting the Design Mode command on the Form menu.

Drag the border of the form with the mouse, just as you would re-size any window.

Make sure all the controls appear on the form without having to scroll it.  If all controls are fully within the border of the form, there will be no scroll bars on the form itself.

Leave design mode and save the form design


Change the location of a form on the desktop

When a form is opened, its initial position on the desktop is the position it had when the design was last saved.  To change the initial position

Place the form in design mode

Move the form to the desired position by dragging it by the title bar

Leave design mode and save the form design


Include a search window on a form

Put the form in design mode

Select the Form Attributes command on the Form Design menu to display the Form Attributes dialog

Check the Search Window option

Click the Search icon [image] to display the search window

Drag the search window to the appropriate size and design it.  See Designing a Form Search Window.

Press Esc to close the search window

Leave design mode and save the form design


Design a form for importing and exporting data

Put the form in design mode

Select the Form Attributes command on the Form Design menu

Check the Data Exchange Template option

Select the Data Exchange Template command on the Form Design menu

See Designing Data Exchange Template for details

Leave design mode and save the form design


Define the data view of a new form

When you create a new form, the Data View dialog is displayed automatically.  You must define a data view before you can lay out the form.  On the Data View dialog:

Specify the table whose records you want to edit as the root table.

Add the fields you want to display on the form to the Fields in the View list.

In most cases, don't specify a sort or filter for the form's view (see other help topics in this section)

When you accept the entries on the Data View dialog, the form window is displayed in design mode and you can design the form layout.


Select the fields for a form

Specify the database fields that will appear on a form on the Data View dialog.

Guidelines for selecting fields

Select all fields from the root table that you want to edit on the form

If the form will be used to add new records, you must at least include all the fields in the root table that have been defined as required fields.

Select fields from other tables linked to the root table if you want to display them on the form for informational purposes.  Linked fields cannot be edited.

If there is a link to another table defined for a field (See Table Links) the field will have a lookup window attached.  Include fields from the linked table that you want to appear in the lookup window to help with the lookup.  (See Designing Lookup Windows).


Specify the sort order of a form

In most cases, don't specify a sort order.  You can't add or delete records from a form that has a sort order that is not an index of the root table.

Add a search window to the form.  You can select an index on the search window while using the form, and that selection also applies to order of records on the form.

A form without a search window or sort specification is sorted by the primary key index.

For special purposes, you can specify a non-index sort order for a form, but you can only edit records in this case and the form must perform a sort each time it opens.


Specify a filter for a form

If you want to use the form to edit a subset of records in the root table, you can select the records the form will display by specifying a filter in the data view.

Put the form in design mode

Select the Data View command on the Form Design menu to display the Data View dialog.

Click the Filter button to define the filter.  See Filter Rules Dialog and Edit Filter Rule Dialog.

Leave design mode and save the form design (unless the filter is needed only for the current session).

Note: The search window will have the same filter as the form.


Specify fields used in lookup windows

A lookup window displays fields from another table linked to the root table.  The lookup window for a particular field is controlled by the Table Link used to validate that field.

All linked fields defined by this link that are included in the data view for the form will appear automatically as columns in the lookup window.

If you don't specify any linked fields, only the primary key field(s) of the linked table will appear in the lookup window.

See Designing Lookup Windows.


Display a field on a form

A field is displayed on a form by placing a form control on the form.  See Designing Form Controls.


Place a control on a form

Click the right mouse button over an uncovered area of a form in design mode

Select one of the four New control commands for the type of control you want

Describe the control on the control attributes dialog and accept the dialog entries

Move the mouse cursor to the location for the top left corner of the control

Click the left button

Drag and size the control as necessary

See Designing Form Controls for details


Change the attributes of a control

Put the form in design mode

Move the mouse cursor over the control or its title

Click the right mouse button

Change the attributes on the control attributes dialog

You can also

Select the control by tabbing to it or clicking it with the left mouse button

Select the Edit Selected Controls command on the Form Design menu

If more than one control is selected, the appropriate control attributes dialogs will be displayed sequentially for the selected controls


Change the title of a control

With the form in design mode, click the right mouse button on the control

Change the title on the control attributes dialog

See Change the attributes of a control


Change the border style of a control

You can change the border style for edit controls and text boxes.

With the form in design mode, click the right mouse button on the control to display the control attributes dialog

Select either the None, Underline, or Border option for edit controls

Set the Border and Vertical Scroll Bar options on or off for text boxes.

See Designing Form Controls for details.


Make a control display-only

With the form in design mode, click the right mouse button on the control to display the control attributes dialog

Check the Display Only style

Note:

Combo box controls cannot be set to display-only - use a display only edit control instead.

Controls that will automatically be display only include

Controls for linked fields not in the root table

Controls for fields that are part of indexes defined as non-modifiable, except when the form is adding a new record


Change the size of a control

Select the control by clicking on it with the left mouse button.  A dotted outline defining the selection border of the control will appear.

Move the mouse cursor to an edge or corner of the selection border until the cursor changes shape.

Drag the border until the control is the desired size.

The height of an edit control is determined by the size of the font.  You can change its width only.

See Sizing Controls


Move a control

Select the control by clicking on it with the left mouse button.  The selection border will appear.

Click and hold the left mouse button and drag the control to the desired location.
or
Press the arrow keys (up, down, left, or right) to move the control.
Press Enter to accept the move, or Esc to cancel the move

Avoid overlapping controls on the form

See Moving Controls


Remove a control from a form

Click on the control with the left mouse button to select it

Press the Del key
or
Select the Delete Control command on the Form Design menu


Change an edit control to a combo box

Remove the edit control

Insert a new combo box control for the same field

You can use a combo box control only for fields that have been defined with the Lookup validation type.  See Define Field Dialog.


Select a group of controls

Drag a selection rectangle around the controls to be selected

or

Hold the Shift key and click on each controls with the left mouse button

or

Hold the Shift key and press the Tab key to move from control to control

See Selecting Controls.


Un-select controls

To un-select all controls, click the left mouse button on an area of the form not covered by a control

To un-select one control when a group of controls is selected, hold the Shift key down and click the left mouse button on that control


Move a group of controls

Select the controls to be moved

Click on any one of the selected controls with the left mouse button

Drag the group to the desired location and release the mouse button

See Moving Controls.


Align selected controls on a form

Select the controls you want to align

Click on the appropriate alignment icon on the control pad

See Aligning Controls.


Make selected controls the same size

A group of selected controls can be made the same widths, either growing all to the width of the largest, or shrinking all to the width of the smallest.

Select the controls

Click one of the two alignment sizing icons on the control pad.

See Aligning Controls.


Set the tab order of controls

Select the Set Tab Order command on the Form Design menu

Click the left mouse button on each control on the form, in the order you want to use for tabbing

See Changing the Tab Order of Controls.


Specify form fonts

With the form in design mode, select the Fonts command on the Form Design menu to display the Fonts dialog.  See Fonts Dialog for details.


Specify form colors

With the form in design mode, select the Colors command on the Form Design menu to display the Colors dialog.  See Colors Dialog for details.


Include a search window on a form

With the form in design mode, select the Form Attributes command on the Form Design menu.

On the Form Attributes, check the Search Window feature.

Select OK to put away the dialog

Click the Search [image] icon on the form control pad to display the new search window

With the left mouse button, drag the bottom right corner of the search window to make an appropriate size

See help on Designing Lists for details, using the following guidelines:

The root table of the search window view must be the same table as that of the form

Include the fields in the view that you want to appear in the search window columns

Don't specify a sort or filter for the search window

Select the sort option in the list sort control that you want to be the default for the form itself.


Include lookup windows for fields

Ad Hoc automatically includes a lookup window for each control on the form associated with a field that:

Has a validation type specified in the data dictionary

Is specified in a link to another table


Specify the columns in a lookup window for a control

With the form in design mode, select the Data View command on the Form Design menu to display the Data View dialog

In the "Fields in the root table" list on the right side of the dialog, find and highlight the link ID for which the field to be looked up is the foreign key

Click the More button to display the fields from the linked (lookup) table

Add the desired fields from this list to the Fields in the View list by highlighting each and selecting Add, or double-clicking each entry.

Select OK on the Data View dialog

All fields selected from the linked table will as columns in the lookup window


Procedures Index

Desktop

Setting Options

Databases

Forms

Designing Forms

Lists

Designing Lists

Printing and Displaying Reports

Designing Reports

Diagnosing Problems


Desktop Procedures

Up

Open a database

Close a database

Open a form or list

Close an object on the desktop

Save a desktop layout

Retrieve a previously saved desktop layout

Display the Tables Window

Exit Ad Hoc


Open a database

When no database is currently open

If the database appears among the recent database entries on the File menu, select it

otherwise

Select the Open Database command on the File menu

Use the Open dialog to find and select the data dictionary file (the file name is the database ID and file extension .ddf) for the desired database

Select OK

To open a different database when one is already open

If the database was recently open, select its entry at the bottom of the Database menu

otherwise

Select the Open Database command on the Database menu

Use the Open dialog to find and select the data dictionary file (ending in .ddf) for the database to open

Select OK


Close a database

Select the Close command on the Database menu.


Open a form or list

Select the Open command on the File menu

Select the desired form or list from the Open dialog

Select OK


Close an object on the desktop

To close any desktop object, including forms .lists, report windows, and the Tables window:

Make sure the object is the active desktop object

Select the Close command on the File menu
or
Double-click the system menu icon in the upper left corner of the desktop object

To close all desktop objects, select the Close All command on the Window menu


Save a desktop layout

To save the current layout of forms and lists, and any links between them:

Select the Save Desktop command on the File menu

Supply an identifier for the layout an a description on the Save Desktop dialog

Select OK


Retrieve a previously saved desktop layout

Objects currently on the desktop will still be there after you retrieve a layout unless you close them first

Select the Open command on the File menu

Make sure the Desktop option is checked on the Open dialog so that desktop layouts are included in the list

Highlight the entry for the desktop layout and select OK or double-click the entry


Display the Tables Window

Select the Tables Window command on the View menu

or

Press F10


Exit Ad Hoc

Select the Exit on the File menu

or

Double-click the system menu icon on the Ad Hoc main window


Setting Options

Up

Specify startup screen display options

Specify keystroke navigation option for lists

Turn record locking on and off

Set confirmation options for selected actions

Specify the commands on the desktop fastmenu

Specify diagnostic warning levels


Specify startup screen display options

Select the Desktop Configuration command on the Options menu

Set the Desktop Options you want on the displayed Desktop Configuration dialog.

Select OK.


Specify keystroke navigation option for lists

Select the Desktop Configuration command on the Options menu

Set the Keystroke Navigation for Lists options on the displayed Desktop Configuration dialog

Select OK.


Turn record locking on and off

Select the Database Options command on the Options menu

Set the Record Locking option on the displayed Database Options dialog.

Select OK.


Set confirmation options for selected actions

Select the Confirmation Options command on the Options menu

Set the options on the Confirmation Options dialog

Select OK.


Specify the commands to appear on the desktop fastmenu

Select the FastMenu Options command on the Options menu

In the top panel of the displayed FastMenu Options dialog, select the commands you want to appear on the desktop fastmenu

If you selected the List of recent reports option, specify in the middle panel of the dialog the subcommands for each recent report listed on the fastmenu

If you selected the recent forms or recent reports options in the top panel, specify in the bottom panel the maximum number of recent form or report entries that will appear on the fastmenu

Select OK.


Specify diagnostic warning levels

Select the Diagnostics Options command on the Options menu

On the displayed Diagnostics Options dialog, specify the severity level of design errors that will cause a diagnostics report to be displayed each time:

a form or list is opened

a report is printed

a database is opened

Select OK.


Diagnosing Problems

Up

Check the file status of a database table

Check the design of a database table

Check the design of entire data dictionary

Check the design of a form or list

Check the design of a report


Check the file status of a database table

Select the Tables Window command on the View menu, or press F10, to display the Tables Window

Find the table in the list of database tables

If the Status column shows No File for the table, see Missing Database Table Files

If the Status column shows Error in file, see Damaged Database Table Files


Check the design of a database table

Select the Tables Window command on the View menu, or press F10, to display the Tables Window

Highlight the desired table in the list on the Tables Window

Select the Run Table Diagnostics command on the Tables menu

See Diagnostics Window for help on the window that displays the result of the diagnostics

Fix any problems by editing the table design


Check the design of entire data dictionary

Select the Tables Window command on the View menu, or press F10, to display the Tables Window

Select the Run Database Diagnostics command on the Tables menu

See Diagnostics Window for help on the window that displays the result of the diagnostics

Fix any problems by editing the design of the tables with errors


Check the design of a form or list

Use the Open command on the File menu to open the form (or list)

Select the Run Diagnostics command on the Form (or List) menu

See Diagnostics Window for help on the window that displays the result of the diagnostics

If there are problems:

Select the Design Mode command on the Form (List) menu and correct the problems

Select the Save command on the File menu , or press F4, to save the modified design


Check the design of a report

Select the Design Report command on the File menu to display the report selection dialog

Select the desired report in the list and select OK to display the report design window

Select the Run Diagnostics command on the Report menu

See Diagnostics Window for help on the window that displays the result of the diagnostics

If there are problems:

 correct the report design on the report design window

Select the Save command on the File menu to save the modified design


Database Procedures

Up

General Procedures

Create, open, close, a database, add a table

Tables

Table design procedures

Database Maintenance


General Database Procedures

Up

Create a new database

Open a database

Close a database

Design a database

Make changes to a database design

Delete a database

Add a new table

Delete a table


Tables

Up

Add a field to a table

Remove a field from a table

Change the definition of field

Add an index to a table

Remove an index from a table

Define a link (relation) between two tables


Database Maintenance

Up

Rebuild a database file

Reclaim unused space in a file


Create a new database

Select the Create New Database command on the Database menu (or on the File menu is no database is currently open)

Assign the new database an ID, Name, and a subdirectory location on the New Database dialog

Select OK

See Creating a New Database for details


Design a database

Close all forms, lists, and reports that are open on the desktop

Select the Tables Window command on the View menu to open the Tables Window

Select commands on the Tables menu to add tables and edit table definitions

See Designing a Database for details


Make changes to a database design

Close all forms, lists, and reports that are open on the desktop

Select the Show Tables Window command on the Tables menu to open the Tables Window

Select commands on the Tables menu to add tables and edit table definitions

See Changing a Database Design for details


Delete a database

See Deleting a Database


Add a new table

Select the Tables Window command on the View menu to open the Tables Window

Select the New Table on the Tables menu to display the Database Table dialog

Define the new table on the dialog and select OK

Verify that the Status column on the Tables Window shows that a file was created for the table

See Designing a New Table for an overview of the steps in designing a table


Delete a table

Close all open forms, lists, and reports on the desktop

Select the Tables Window command on the View menu to open the Tables Window

Highlight the entry for the table on the Tables Window

Select the Delete Table command on the Tables menu

Confirm that you want to remove the table definition from the data dictionary

Ad Hoc will ask you if you also want to delete the DOS file for the table, Select Yes to delete the table file


Add a field to a table

Close all open forms, lists, and reports on the desktop

Select the Tables Window command on the View menu to open the Tables Window

Highlight the entry for the table on the Tables Window

Select the Edit Table Definition command on the Tables menu

Select the Fields button to display the table fields

Select Add to add a new field at the end of the list
or
Highlight an entry in the list and select Insert to insert a new field before that entry

Define the field on the Define Field dialog

Select OK on the Define Field Dialog

Select OK on the Database Table Dialog

If the table contains records, Ad Hoc will rebuild it to add the new field.  The field will contain a null value in all records.


Remove a field from a table

Close all open forms, lists, and reports on the desktop

Select the Tables Window command on the View menu to open the Tables Window

Highlight the entry for the table on the Tables Window

Select the Edit Table Definition command on the Tables menu

Select the Fields button to display the table fields

Highlight the entry for the field in the Fields list

Select Delete

Select OK on the Database Table Dialog

If the table contains records, Ad Hoc will rebuild it to delete the field from all records.


Change the definition of field

Close all open forms, lists, and reports on the desktop

Select the Tables Window command on the View menu to open the Tables Window

Highlight the entry for the table on the Tables Window

Select the Edit Table Definition command on the Tables menu

Select the Fields button to display the table fields

Highlight the field in the Fields list

Select Change to display the Define Field dialog

Modify the definition of the field

Select OK on the Define Field Dialog

Select OK on the Database Table Dialog

If you have changed the data type and size of the field, and the table contains records, Ad Hoc will rebuild the table to change the way the field is stored in each record.  If you have changed the data type, Ad Hoc will attempt to translate the old value of the field to the new type.  If this is not possible, the field will be blanked in each record.


Add an index to a table

Close all open forms, lists, and reports on the desktop

Select the Tables Window command on the View menu to open the Tables Window

Highlight the entry for the table on the Tables Window

Select the Edit Table Definition command on the Tables menu

Select the Indexes button to display the table indexes

Select Add to add an index to the end of the list
or
Highlight an entry and select Insert to insert a new index before the entry

Don't put the new index at the top of the list unless it is to be the primary key index

Define the index on the Define Index dialog

Select OK on the Define Index dialog

Select OK on the Database Table dialog

Ad Hoc will rebuild the table file to add the new index


Remove an index from a table

Close all open forms, lists, and reports on the desktop

Select the Tables Window command on the View menu to open the Tables Window

Highlight the entry for the table on the Tables Window

Select the Edit Table Definition command on the Tables menu

Select the Indexes button to display the table indexes

Highlight the index

Don't delete the first index in the list (the primary key index unless you intend to make the one below it the new primary key index

Select Delete to delete the index from the table definition

Select OK on the Database Table dialog

Ad Hoc will rebuild the table file to remove the index


Define a link (relation) between two tables

Close all open forms, lists, and reports on the desktop

Select the Tables Window command on the View menu to open the Tables Window

Highlight the entry for the table on the Tables Window

Select the Edit Table Definition command on the Tables menu

Select the Links button on the Database Table dialog to display the list of links for the table

Select Add to display the Edit Link dialog

Define the link (see Table Links for help on links and Edit Link Dialog for help on using the dialog

Select OK on the Edit Link dialog

Select OK on the Database Table dialog


Rebuild a database file

Select the Tables Window command on the View menu to display the Tables Window

Highlight the entry for the database table that you want to rebuild

Select the Rebuild Table File command on the Tables menu

Confirm that you want to rebuild the table

When the rebuild process is completed, press OK on the process window to close it


Reclaim unused space in a file

See Using the Rebuild command to shrink a database file


Procedures for Lists
Procedure for Lists

Up

General Procedures

Opening and closing lists.  The procedures are the same as for forms.

Using Lists to Display Data

Scrolling, finding records

Using Lists to Edit Data

Adding, changing, deleting records

Other Procedures

Saving desktop layouts, Linking lists and forms on the desktop

Procedures for Designing Lists


General List Procedures

Up

Open a list

Close a list

Close all objects on the desktop

Remove a list from the database

Save a list design to an external file

Read a list design from an external file


Using Lists to Display Data

Up

Scroll through records on a list

Find a record

Change the record selection filter

Change the sort order of a list


Using Lists to Edit Data

Up

Edit a record

Canceling changes to a record

Add a new record to the database

Delete a record


Other List Procedures

Up

Link a list to another

Unlink a list from another

Attach a report to a list

Print the selected record on a list

Detach a report from a list


Scroll through records on a list

To highlight the first record: Press the Home key, or drag the scroll box to the top of the scroll bar

To highlight the last record: Press the End key, or drag the scroll box to the bottom of the scroll bar

Move the highlight up or down with the up an down keys, or click on the scroll bar arrows

Move the highlight up or down a screen full at a time by pressing the PgUp or PgDn keys, or clicking in the area of the scroll bar between the arrows and the scroll box


Find a record on a list

Use the list's search control

Use keystroke navigation


Change the record selection filter

Select the Filter command on the list fast menu.

Edit the filter rules on the Filter rules dialog

Select OK to set the filter

 Filter rules set this way are not stored permanently in the list design unless you subsequently save the list.


Change the sort order of a list

Use the list's sort control to change the sort order to either one of the indexes of the lists primary table or the sort specification (if any) defined on the Data View dialog for the list


Edit a record

You can edit records on a list only if it has the AddEditDelete style.  See Designing Lists

Highlight the record in the list

Select Edit by Clicking the Edit button or pressing Alt-E
or
Double-click the record in the list

Make changes on the pop-up edit form

Press Enter or click the Update [image] icon


Canceling changes to a record

Click the Cancel [image] icon on the pop-up edit form.


Add a new record to the database

You can add records using a list only if it has the AddEditDelete style.  See Designing Lists

Select Add by clicking the Add button or pressing Alt-A to display the pop-up edit form

Fill out the form

Press Enter or Click the Update [image] icon


Delete a record

You can delete records using a list only if it has the AddEditDelete style.  See Designing Lists

Highlight the record in the list

Select Delete by clicking the Delete button or pressing Alt-D


List Design How To's
Procedures for Designing Lists

Up

General Procedures

Creating a new list, editing and saving list designs

Specifying List Data

Defining the data view, sort specification, filters

List Layout

Placing controls on the list, laying out columns

Procedures for Using Lists


General List Design Procedures

Up

Create a new list

Change a list design

Save a list design

Switch between run and design mode

Change the size of a list

Set the location of a list on the desktop

Delete a list

Check the design of a list


Specifying Data on a List

Up

Define the data view of a new list

Select the fields for a list

Specify the sort order

Specify a filter

Specify fields used on the pop-up edit form


List Layout

Up

Specify a sort control on a list

Specify a search control on a list

Specify the columns in  a list

Specify list column headings

Specify column widths

Specify the alignment style of a column

Include an edit form with a list

Specify fonts on a list

Specify colors on a list


Create a new list

Select the New command from the File menu

Select the option for a new list

See other How To's for details on these steps:

Enter an ID and Name for the new list, and specify other options as desired on the List Attributes dialog.

Define the data view for the list on the Data View dialog.

A new list will open on the desktop in design mode

Specify the columns in the list by using the List Column Fields dialog.

Size and align the columns

Run diagnostics by selecting the Run Diagnostics command on the List Design menu.

Leave design mode by selecting the Leave Design Mode command on the List Design menu.

Save the list.


Change a list design

Open the list by selecting the Open command on the File menu, then selecting the list from the Open dialog.

Place the list in design mode by selecting the Design Mode command on the List menu.

Make the desired changes

Leave design mode by selecting the Leave Design Mode command on the List Design menu.

Run diagnostics on the list by selecting the Run Diagnostics command on the List menu.

Select the Save command on the File menu to save the list.


Save a list design

Ad Hoc will save a list design only if the list is in design mode, or if the list design has changed.

Make sure the list is the active desktop object

If this is a new list, make sure the ID and Name you entered on the List Attributes dialog aren't duplicates of another form or list already in the database.

Select the Save command on the File menu
or
Press the F4 key


Switch to and from design mode

To put a list in design mode

Click the right mouse button when the cursor is over the list

Select the Design Mode command on the List menu

To take a list out of design mode

Click the right mouse button when the cursor is over the list

Select the Leave Design Mode command on the List Design menu


Delete a list design

To remove a list design from the database

Select the Delete command on the File menu.

Select the list from the list on the Delete dialog

Confirm that you want to delete the list


Check the design of a list

Select the Run Diagnostics command on the List menu or the List Design menu


Change the size of a list

Place the list in design mode by selecting the Design Mode command on the List menu.

Drag the border of the list with the mouse, just as you would re-size any window.

Leave design mode and save the list design

This is the size the list will be when it first opens.  After a list is open, you can change the size at any time in the same way.  You can also maximize the list.


Change the location of a list on the desktop

When a list is opened, its initial position on the desktop is the position it had when the design was last saved.  To change the initial position

Place the list in design mode

Move the list to the desired position by dragging its title bar, size the list by dragging its border

Leave design mode and save the list design


Define the data view of a new list

When you create a new list, the Data View dialog is displayed automatically.  You must define a data view before you can specify the columns of the list or lay out the (optional) edit form.  On the Data View dialog:

Specify the primary table associated with the list as the primary table.  If you are editing fields on a pop-up edit form, only fields from the primary table can be edited.

Add the fields you want to display in the list columns or the edit form to the Fields in the View list.

Specify a sort or filter for the lists view (see other help topics in this section)

When you accept the entries on the Data View dialog, the list is displayed in design mode.


Select the fields for a list

Specify the database fields that will appear in the columns or edit form of the list on the Data View dialog.

Guidelines for selecting fields

Select all fields from the primary table that you want to display in columns on the list, or edit on the (optional) edit form

If the edit form will be used to add new records, you must at least include in the view and on the edit form all the fields in the primary table that have been defined as required fields.

Select fields from other tables linked to the primary table if you want to include them in list columns or on the edit form for informational purposes.  Linked fields cannot be edited.

If there is a link to another table defined for a field (See Table Links) the corresponding control on the edit form will have a lookup window attached.  Include fields from the linked table that you want to appear in the lookup window.  (See Designing Lookup Windows).


Specify the sort order of a list

In most cases, don't specify a sort order.  A list can automatically be ordered by the indexes of it's view's primary table.  Adding an additional sort specification to the view definition will required the list to be sorted each time it opens.

For special purposes, you can specify a non-index sort order for a list by specifying a sort specification on the Data View dialog.


Specify a filter for a list

Put the list in design mode

Select the Data View command on the List Design menu to display the Data View dialog.

Click the Filter button to define the filter.  See Filter Rules Dialog and Edit Filter Rule Dialog.

Leave design mode and save the list design (unless the filter is needed only for the current session).


Specify fields used on the pop-up edit form

If a list has an attached edit form, the form shares the same view as the list.  Include the fields to be on the form when you specify the fields for the list's data view.  Only fields in the primary table of the view can be edited on the form.

Design the fields of the edit form of a list just as you would with a desktop form.


Specify a sort control on a list

With the list in design mode, select the List Attributes command on the List Design menu to display the List Attributes dialog

In the Style panel of the dialog, check the Sort Control option

Select OK


Specify a search control on a list

With the list in design mode, select the List Attributes command on the List Design menu to display the List Attributes dialog

In the Style panel of the dialog, check the Search Control option

Select OK


Specify the columns in  a list

With the list in design mode, select the Data View command on the List Design menu to display the Data View dialog

Add a field to the Fields in the View list for each column you want in the list

Select OK

Select the Columns command on the List Design menu to display the List Column Fields dialog

Select the fields to be displayed in the list columns in the order you want them to appear, from right to left

Select OK on the List Column Fields dialog


Specify list column headings

Select the Columns command on the List Design menu to display the List Column Fields dialog

Check the Display Column Headings option on the dialog

Ad Hoc will assign as default column headings the titles you entered for the fields when you defined them

To change a column heading

Highlight the corresponding field in the Column Fields list

Edit the column heading for this field in the Column Heading edit control

To create a multi-line heading, press Enter to start a new line


Specify column widths

With the list in design mode, move the mouse cursor to the tab in the list's tab bar that is to the  right of the column you want to size.

Click and drag the tab with the left mouse button

To move all tabs to the right of the one you are dragging, hold down the Shift key before you drag the tab


Specify the alignment style of a column

With the list in design mode, click the right mouse button on the tab in the list's tab bar that is associated with the column

Select the alignment style from the displayed tab menu

Drag the tab as necessary to place the column


Include an edit form with a list

With the list in design mode, select the List Attributes command on the List Design menu to display the List Attributes dialog

Select the AddEditDelete style

Select the Database Access permission options you want for the list

Select OK

Select the Data View command on the List Design menu to display the Data View dialog

Include in the view fields the fields you want to appear on the edit form

 Select OK

Click the Edit button (or Add button if its not grayed) on the list to display the pop-up edit form

Drag the bottom right corner of the edit form with the mouse to size it

Design the layout of the form just as you would a desktop form (See Designing Forms or How To topics on designing forms)

Click the Cancel [image] icon on the edit form, or select the Hide Pop-up Form command from its Design menu to hide the edit form


Specify fonts on a list

With the list in design mode, select the Fonts command on the List Design menu to display the Fonts dialog


Specify colors on a list

With the list in design mode, select the Colors command on the List Design menu to display the Colors dialog


Limited Warranty

This software and accompanying files and documentation are licensed "as is" and without any warranty as to performance or fitness for any particular use, or any other warranties expressed or implied.  The user must assume the entire risk of using this program.

If you have paid the registration fee for a license to use the software, and have received a registered version of the software from ExLogica, ExLogica warrants that the disks provided are free from defects in material and workmanship, assuming normal use, for a period of 90 days from the date of registration.  If a defect in the disk occurs during this warranty period, you may return the disk(s) for a replacement.

EXLOGICA DISCLAIMS ALL WARRANTIES, EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, WITH RESPECT TO THE PRODUCT.  SHOULD THE PROGRAM PROVE DEFECTIVE, THE PURCHASER ASSUMES THE RISK OF PAYING THE ENTIRE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION AND ANY INCIDENTAL OR CONSEQUENTIAL DAMAGES.  IN NO EVENT WILL EXLOGICA  BE LIABLE FOR ANY DAMAGES WHATSOEVER (INCLUDING WITHOUT LIMITATION DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF DATA, OR THE LIKE) ARISING OUT OF THE USE OR THE INABILITY TO USE THIS PRODUCT  EVEN IF EXLOGICA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

In no event shall the liability of ExLogica for any damages to you or any other person exceed the lesser of the suggested list price or the actual price paid for the license to use the software, regardless of any form of the claim.

Your use of this product for any period of time constitutes your acceptance of this agreement and subjects you to its contents.


 Ad Hoc Order Form

You can order Ad Hoc in the following ways:

Mail this completed form, along with your payment or charge information to: ExLogica 59 Golden Eagle Lane Littleton, CO 80127-5750 USA	Fax this completed form to   (303) 933-1075 or call to place a charge order:   (303) 933-8553
_____ copies of Ad Hoc   @ $69.95 each	$ ____________
Shipping and Handling  US: $6 per copy, Canada/Mexico: $9 per copy,  International: $15 per copy	____________
Colorado residents add 3% sales tax	____________
Total Payment	$ ____________
Payment Method:   ___Mastercard     ___Visa   ___Check/Money Order ($US)

Charge Card Number  __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __   Expires __/__

Signature (for charge orders)
Date
Your Name
Company
Address
Zip/Postal Code		Country
Telephone (in case of problems with your order)
Fax		E-mail Address
How did you hear about Ad Hoc?
Comments


Technical Support and Questions

Technical support is available from ExLogica at no charge through the following means:

Electronic mail:	Compuserve	75136,1033
Internet 	75136.1033@compuserve.com

US Mail.  Send questions to:

ExLogica
59 Golden Eagle Lane
Littleton, CO 80127-5750

Fax at (303) 933-1075

Registered users only - telephone support - (303) 933-8553

Support to registered users will receive priority. Telephone support will be available to registered users only.  Due to the low price of Ad Hoc, we regret that we cannot offer telephone (voice) support generally.

If you have a question about a feature or a procedure in Ad Hoc, please try to find the answer in the on-line help system first.  If you still have a problem, please include the following information in your query:

Your user registration number (product serial number)

The type of computer you are using, and the amount of memory.  Are you on a network?

The version of DOS/Windows you are running

What you were doing in Ad Hoc when the problem occurred.

The messages or warnings you received.

How we can get back to you by E-mail, fax, or mailing address.